Issue 114937 - MacOS X termination does not return from Application::Execute
Summary: MacOS X termination does not return from Application::Execute
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: 3.4.0
Assignee: carsten.driesner
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-05 12:56 UTC by Stephan Bergmann
Modified: 2017-05-20 10:22 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Bergmann 2010-10-05 12:56:45 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.)
Comment 1 Stephan Bergmann 2010-11-10 15:58:49 UTC
(See also issue 115504; termination on Mac OS X apparently fails to call
ImplImageTree::shutDown.)
Comment 2 hdu@apache.org 2010-11-11 13:14:48 UTC
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."
Comment 3 philipp.lohmann 2010-11-11 13:20:55 UTC
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).
Comment 4 philipp.lohmann 2010-11-25 10:14:24 UTC
fixed in CWS vcl117

@cd: please verify
Comment 5 philipp.lohmann 2010-11-25 10:35:45 UTC
Hmm, I see a problem still. Investigating
Comment 6 philipp.lohmann 2010-11-25 12:34:33 UTC
better now

@cd: please verify
Comment 7 carsten.driesner 2010-11-30 10:41:27 UTC
cd: Verified. Checked on Windows and Linux.