Fixed crash when deleting a submodel being edited in another view.

This commit is contained in:
Leonardo Zide 2019-02-09 16:43:39 -08:00
parent 8f59a67924
commit 3128a078cb

View file

@ -1512,10 +1512,14 @@ void lcMainWindow::RemoveView(View* View)
void lcMainWindow::SetActiveView(View* ActiveView)
{
lcModelTabWidget* TabWidget = GetTabForView(ActiveView);
View* CurrentActiveView = TabWidget->GetActiveView();
if (!TabWidget || TabWidget->GetActiveView() == ActiveView)
if (!TabWidget || CurrentActiveView == ActiveView)
return;
if (CurrentActiveView)
CurrentActiveView->SetTopSubmodelActive();
TabWidget->SetActiveView(ActiveView);
UpdateCameraMenu();