mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-18 16:32:06 +00:00
Prevent script execution during shutdown
Skip script action calls when the application is closing to avoid post-teardown issues.
This commit is contained in:
@@ -270,10 +270,14 @@ private:
|
||||
}
|
||||
// why: value-capture only. Script execution may outlive this popup if the app is closing.
|
||||
wxGetApp().CallAfter([id] {
|
||||
// why: the queue may drain during shutdown, after MainFrame/Plater teardown;
|
||||
// skip like the ScriptActionSource callbacks do instead of running into it.
|
||||
if (wxGetApp().is_closing())
|
||||
return;
|
||||
AppActionRunResult o = wxGetApp().action_registry().run(id);
|
||||
if (o.level == AppActionRunResult::Level::Busy)
|
||||
return;
|
||||
if (!o.message.IsEmpty())
|
||||
if (!o.message.IsEmpty() && wxGetApp().plater())
|
||||
wxGetApp().plater()->get_notification_manager()->push_notification(
|
||||
NotificationType::CustomNotification,
|
||||
o.level == AppActionRunResult::Level::Error ? NotificationManager::NotificationLevel::ErrorNotificationLevel :
|
||||
|
||||
Reference in New Issue
Block a user