autoquit = True
in the app.Open event I bet that solves your problem as your app will quit when you close the last window[/quote]
I’m a little reticent to try this simply because I want to have full control over when the app quits - not have it be triggered as a side effect. I suppose I could try moving my clean up code to the app.close event, and set autoquit = true.
With autoquit=true, can I guarantee that app.close() will always fire when the app autoquits?
@Tim Jones : Thanks! I used Trixie’s declare (massaged slightly for use in my app.shutdown method rather than in the window close or cancelClose event), and the crash has disappeared:
[code]//exit the process #if TargetWindows
quit #elseif TargetMacOS 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]
[quote=383752:@Kimball Larsen]@Christian Schmitz - in your feedback report referenced above (#51965) you commented:
Where, specifically should I put this loop?
Thanks![/quote]
I have it in app.open where I setup the containers.
The terminate declare may not be a good thing as all the destructors may not fire, so app may close without proper cleanup!
[quote=383657:@Beatrix Willius]Post the crash log.
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]
This cleanly terminates the app.[/quote]
Be very careful with this if you put it in App,CancelClose, it will prevent you from returning True to stop the app from closing - for instance, if there’s unsaved data.