In the handling of OSXOnWillTerminate(), the TLW is Close()d, but not deleted (the pending cleanup never occurs), additionally, OnExit() is never called.
When clicking "Quit" from the Dock, Cocoa ends up in -[NSApplication terminate:], which calls exit(0) more or less immediately after sending applicationWillTerminate:, and the documentation reads:
Don’t bother to put final cleanup code in your app’s main() function—it will never be executed. If cleanup is necessary, perform that cleanup in the delegate’s applicationWillTerminate: method.
So then, this PR changes wxOSX's wxApp::OnEndSession() to do cleanup similarly to the wxMSW port, making sure that OnExit() and all other cleanup is performed (part of that cleanup is deleting TLWs, so I've removed the Close()).
https://github.com/wxWidgets/wxWidgets/pull/26542
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz approved this pull request.
Thanks, assuming the comment is correct about there being no better place to do this, this looks the right thing to do to me.
Of course, as always, I'd prefer @csomor's confirmation before merging this if possible.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Actually, the sequence of calling all the app callbacks was once preserved. I'll have to investigate.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Ok, some flows are not the way they used to be, the system does not emulate a quit-app apple event anymore, but still putting these things in wxApp::OnEndSession seems too general to me, I'd rather add
wxTheApp->CallOnExit();
wxEntryCleanup();
at the end of - (void)applicationWillTerminate: directly, since for this we are given the contract, that exit will soon be called
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@csomor Would you still want to keep the TLW Close in OnEndSession()? I’m not sure what problem is solved having that there…
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()