Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: MacOS dont process finalization blocks



Permlink Replies: 2 - Last Post: Jun 5, 2014 3:00 AM Last Post By: Ronald Klitsche Threads: [ Previous | Next ]
Ronald Klitsche

Posts: 326
Registered: 8/26/01
MacOS dont process finalization blocks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 4, 2014 3:36 AM
Hi,

the MacOS compiler doesn't process the unit finalization blocks.
http://qc.embarcadero.com/wc/qcmain.aspx?d=121751

Is there any workaround, e.g. trigger that by own code?

Ronald
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: MacOS dont process finalization blocks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 4, 2014 12:52 PM   in response to: Ronald Klitsche in response to: Ronald Klitsche
Ronald wrote:

the MacOS compiler doesn't process the unit finalization blocks.
http://qc.embarcadero.com/wc/qcmain.aspx?d=121751

Known problem:

Report No: 118827
[MacOS] applications do not run unit finalization
http://qc.embarcadero.com/wc/qcmain.aspx?d=118827

TPlatformCocoa.Terminate in FMX.Platform.Mac calls NSApp.Terminate(Nil) -
which is similar to a Delphi HALT.

It should call NSApp.Stop(Nil);

Once this change is made, the application is allowed to correctly unspool.
However, as this code path has never been run before, it generates errors
that will need to be tracked down and a graceful app exit issued. Currently,
I am getting SigFaults.

Also found that TPlatformCocoa.CreateDefaultMenuItem creates it's QUIT menu
option to call the NSApp.Terminate routine, it should also be modifed to
call Stop instead to allow for proper shutdown and unit finalization

Oh, and this bug seems to extend to the iOS framework as well.

--
Remy Lebeau (TeamB)
Ronald Klitsche

Posts: 326
Registered: 8/26/01
Re: MacOS dont process finalization blocks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 5, 2014 3:00 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Once this change is made, the application is allowed to correctly unspool.
However, as this code path has never been run before, it generates errors
that will need to be tracked down and a graceful app exit issued.
Currently,
I am getting SigFaults.

Thanks Remy,
it seems that there are still some big basic problems in the Mac part.
That's sad, because Mac support is since XE2 and up to XE6 it's still not
ready.

Ronald
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02