mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-11 14:33:04 +00:00
2.2.0 pre4 (#84)
* Fix crash * Update: Flutter 1223 * fix: networktestdialog crash * Update Flutter 1223 * bump profile version to 02.02.42.02 * bump min_firm_ver to 1.0.0
This commit is contained in:
@@ -889,7 +889,7 @@ void MainFrame::update_layout()
|
||||
}
|
||||
|
||||
// Called when closing the application and when switching the application language.
|
||||
void MainFrame::shutdown()
|
||||
void MainFrame::shutdown(bool isRecreate)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "MainFrame::shutdown enter";
|
||||
// BBS: backup
|
||||
@@ -956,7 +956,7 @@ void MainFrame::shutdown()
|
||||
// to avoid any manipulations with them from App->wxEVT_IDLE after of the mainframe closing
|
||||
wxGetApp().tabs_list.clear();
|
||||
wxGetApp().model_tabs_list.clear();
|
||||
wxGetApp().shutdown();
|
||||
wxGetApp().shutdown(isRecreate);
|
||||
// BBS: why clear ?
|
||||
//wxGetApp().plater_ = nullptr;
|
||||
|
||||
@@ -2308,9 +2308,25 @@ static wxMenu* generate_help_menu()
|
||||
});
|
||||
|
||||
append_menu_item(helpMenu, wxID_ANY, _L("Open Network Test"), _L("Open Network Test"), [](wxCommandEvent&) {
|
||||
NetworkTestDialog dlg(wxGetApp().mainframe);
|
||||
dlg.ShowModal();
|
||||
});
|
||||
// Use shared_ptr to manage dialog lifetime
|
||||
auto dlg = std::make_shared<NetworkTestDialog>(wxGetApp().mainframe);
|
||||
dlg->ShowModal();
|
||||
|
||||
// Keep dialog alive for 2 seconds after closing to allow background threads to finish
|
||||
// Use a timer to delay the destruction
|
||||
class DelayedReleaseTimer : public wxTimer {
|
||||
std::shared_ptr<NetworkTestDialog> m_dialog;
|
||||
public:
|
||||
DelayedReleaseTimer(std::shared_ptr<NetworkTestDialog> dlg) : m_dialog(std::move(dlg)) {
|
||||
StartOnce(5000); // 5 seconds delay
|
||||
}
|
||||
void Notify() override {
|
||||
m_dialog.reset(); // Release the dialog
|
||||
delete this; // Delete the timer itself
|
||||
}
|
||||
};
|
||||
new DelayedReleaseTimer(dlg); // Timer will delete itself
|
||||
});
|
||||
|
||||
// About
|
||||
#ifndef __APPLE__
|
||||
|
||||
Reference in New Issue
Block a user