From dcf8ddfd95d56dc2254d6de7cbdb4125b4091676 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Fri, 18 Dec 2020 11:04:16 -0800 Subject: [PATCH] Crash fix restoring layout. --- common/lc_mainwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index 1217cec1..04cbf300 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -1618,9 +1618,9 @@ void lcMainWindow::SetCurrentModelTab(lcModel* Model) TabWidget->SetModel(Model); NewView = CreateView(Model); + AddView(NewView); ViewWidget = (lcViewWidget*)TabWidget->layout()->itemAt(0)->widget(); ViewWidget->SetView(NewView); - AddView(NewView); mModelTabWidget->setCurrentWidget(TabWidget); } @@ -1654,8 +1654,6 @@ void lcMainWindow::AddView(View* View) TabWidget->AddView(View); - View->MakeCurrent(); - if (!TabWidget->GetActiveView()) { TabWidget->SetActiveView(View);