From 3128a078cbc9f935420536a66521f8545e8f4bb4 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Sat, 9 Feb 2019 16:43:39 -0800 Subject: [PATCH] Fixed crash when deleting a submodel being edited in another view. --- common/lc_mainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index b63ce258..a7634bb8 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -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();