revert wxwidgets control pool

This commit is contained in:
SoftFever 2024-05-05 13:38:37 +08:00
parent c2f5660afd
commit d72c9f923a
7 changed files with 28 additions and 158 deletions

View file

@ -3284,10 +3284,7 @@ void GUI_App::check_printer_presets()
#endif
}
void switch_window_pools();
void release_window_pools();
void GUI_App::recreate_GUI(const wxString &msg_name)
void GUI_App::recreate_GUI(const wxString& msg_name)
{
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "recreate_GUI enter";
m_is_recreating_gui = true;
@ -3295,18 +3292,12 @@ void GUI_App::recreate_GUI(const wxString &msg_name)
update_http_extra_header();
mainframe->shutdown();
ProgressDialog dlg(msg_name, msg_name, 100, nullptr, wxPD_AUTO_HIDE);
dlg.Pulse();
dlg.Update(10, _L("Rebuild") + dots);
MainFrame *old_main_frame = mainframe;
struct ClientData : wxClientData
{
~ClientData() { release_window_pools(); }
};
old_main_frame->SetClientObject(new ClientData);
switch_window_pools();
mainframe = new MainFrame();
if (is_editor())
// hide settings tabs after first Layout