Probably fix for #6270 - Segfault during startup in prusa-slicer-git 2.3.0.r24.gd06aa6069-1

This commit is contained in:
YuSanka 2021-05-11 18:02:18 +02:00
parent b875fd2755
commit de1d36cc9a

View file

@ -544,9 +544,12 @@ void MainFrame::init_tabpanel()
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxBookCtrlEvent& e) {
#if ENABLE_VALIDATE_CUSTOM_GCODE
Tab* old_tab = dynamic_cast<Tab*>(m_tabpanel->GetPage(e.GetOldSelection()));
if (old_tab)
old_tab->validate_custom_gcodes();
if (int old_selection = e.GetOldSelection();
old_selection != wxNOT_FOUND && old_selection < m_tabpanel->GetPageCount()) {
Tab* old_tab = dynamic_cast<Tab*>(m_tabpanel->GetPage(old_selection));
if (old_tab)
old_tab->validate_custom_gcodes();
}
#endif // ENABLE_VALIDATE_CUSTOM_GCODE
wxWindow* panel = m_tabpanel->GetCurrentPage();