From a087c42c405d56a5689541ae1a821d4637390407 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 5 Apr 2024 14:15:24 +0200 Subject: [PATCH] Fixed a crash on "File->Exit". To popup main menu use native wxPanel::PopupMenu() function Don't use wrap function Plater::PopupMenu(), because it's no need in this case --- src/slic3r/GUI/TopBar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/TopBar.cpp b/src/slic3r/GUI/TopBar.cpp index 5ee2a32dce..0355f9fd45 100644 --- a/src/slic3r/GUI/TopBar.cpp +++ b/src/slic3r/GUI/TopBar.cpp @@ -332,7 +332,9 @@ TopBarItemsCtrl::TopBarItemsCtrl(wxWindow *parent) : m_menu_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { m_menu_btn->set_selected(true); wxPoint pos = m_menu_btn->GetPosition(); - wxGetApp().plater()->PopupMenu(&m_main_menu, pos); + // !!! To popup main menu use native wxPanel::PopupMenu() function + // Don't use wrap function Plater::PopupMenu(), because it's no need in this case + wxGetApp().plater()->wxPanel::PopupMenu(&m_main_menu, pos); }); m_main_menu.Bind(wxEVT_MENU_CLOSE, [this](wxMenuEvent&) { m_menu_btn->set_selected(false); }); #endif