Apache OpenOffice (AOO) Bugzilla – Issue 114937
MacOS X termination does not return from Application::Execute
Last modified: 2017-05-20 10:22:25 UTC
Seen on OOO330_m9 unxmacxi.pro that terminating OOo via Option-Q does not cause Application::Execute called within Desktop::Main to return, but rather that synchronously from within Application::Execute, Desktop::QueryExit and then exit is called. This looks suspicious, as Desktop::QueryExit calls less cleanup code than Desktop::Main/Desktop::DeInit. (For a stack, see issue 114936.)
(See also issue 115504; termination on Mac OS X apparently fails to call ImplImageTree::shutDown.)
Regarding application exit and the question whether Desktop::QueryExit() or Desktop::DeInit() should do the cleanup it could be helpful to know that the OSX docs recommend: "don’t put final cleanup code in your application’s main() function—it will never be executed. If cleanup is necessary, have the (NSApplication) delegate respond to applicationWillTerminate: and perform cleanup in that method."
No, really :-) The "idea" up to now was that VCL's static data do not hurt when leaked. Which is true, but has amongst others the bad side effect of static destructors which get then called in "random" order instead of proper DeInit. So, yes, we need to do something. Perhaps cd could give me a method to call to achieve the effect that would on other platforms be had by leaving the main loop (effectivly calling DeInit this and that).
fixed in CWS vcl117 @cd: please verify
Hmm, I see a problem still. Investigating
better now @cd: please verify
cd: Verified. Checked on Windows and Linux.