vogleditor_gl_state_snapshot* VoglEditor::findMostRecentSnapshot_helper(vogleditor_apiCallTreeItem* pItem, vogleditor_gl_state_snapshot*& pMostRecentSnapshot, const vogleditor_gl_state_snapshot* pCurSnapshot)
{
// check if this item has a snapshot shot
- if (pItem->has_snapshot())
+ if (pItem->has_snapshot() && pItem->get_snapshot()->is_valid())
{
vogleditor_gl_state_snapshot* pTmp = pItem->get_snapshot();
if (pTmp == pCurSnapshot)
// state viewer
vogleditor_QStateTreeModel* pStateModel = new vogleditor_QStateTreeModel(NULL);
- vogleditor_QApiCallTreeModel* pTreeModel = static_cast<vogleditor_QApiCallTreeModel*>(ui->treeView->model());
- vogleditor_gl_state_snapshot* pBaseSnapshot = findMostRecentSnapshot(pTreeModel->root(), m_currentSnapshot);
+ vogleditor_gl_state_snapshot* pBaseSnapshot = findMostRecentSnapshot(m_pApicallTreeModel->root(), m_currentSnapshot);
pStateModel->set_diff_base_snapshot(pBaseSnapshot);
pStateModel->set_snapshot(pStateSnapshot);
const vogl_context_desc& desc = pContext->get_context_desc();
vogleditor_stateTreeContextItem* pContextItem = new vogleditor_stateTreeContextItem(tmp.sprintf("Context %p", (void*)desc.get_trace_context()), "", parent, *pContext);
- if (m_pBaseSnapshot != NULL && m_pBaseSnapshot->get_contexts().size() > 0 && m_pBaseSnapshot->get_contexts().at(c) != NULL)
+ if (m_pBaseSnapshot != NULL && m_pBaseSnapshot->is_valid() && m_pBaseSnapshot->get_contexts().size() > 0 && m_pBaseSnapshot->get_contexts().at(c) != NULL)
{
// set the diff state to be the same state, so that there does not appear to be any diff's
const vogl_context_snapshot* pDiffContext = m_pBaseSnapshot->get_contexts()[c];
}
}
- if (bStatus && pItem->has_snapshot() && pItem->get_snapshot()->is_edited())
+ if (bStatus && pItem->has_snapshot() && pItem->get_snapshot()->is_edited() && pItem->get_snapshot()->is_valid())
{
bStatus = applying_snapshot_and_process_resize(pItem->get_snapshot()->get_snapshot());
}