So I’ve finally carved out time to convert my app from 32 to 64 bit for OS X, given the impending deadline for dropping 32 bit apps there. I’ve experimented in the past but run into a number of issues, so I’ve been putting it off for as long as possible.
The day of reckoning has finally arrived.
I’m impressed so far that the application appears to behave perfectly when compiled as a 64 bit app, and it appears that waiting did fix a number of issues I ran into in the past… however, there is one problem that I can’t seem to figure out:
If I quit my application with the Command-Q key shortcut, it quits cleanly. If I close my app’s main window, I get a core dump from the OS.
I seem to remember that quitting in 64bit was discussed before. My problem is that 64bit doesn’t quit at all. A declare was posted which solves this problem:
[code]#if Target64Bit then
declare function NSClassFromString lib “Cocoa” ( aClassName as CFStringRef ) as integer
declare function sharedApplication lib “Cocoa” selector “sharedApplication” ( classRef as integer ) as integer
declare sub terminate lib “Cocoa” selector “terminate:” ( appRef as integer, sender as integer )
Dim appInstance as integer = sharedApplication( NSClassFromString( “NSApplication” ) )
terminate( appInstance, appInstance ) #Endif[/code]
I had a similar problem, I fixed it placing my document closing code into the ‘CancelClose’ event. That way it looks like the document close code is ran before the app close event. That was my problem and it looks like yours is very similar.