Random crash on quit

@Eli Ott: If this was my bug I would get the crash every time I quit the app and - best case - I wouldn’t get a crash but an exception.

That is plausibel and could be the reason why it does not occur when compiling the same project for Windows.

[quote=360730:@Eli Ott]Yes, very often.

You cannot generalize that. If it is an object you create, then checking for Nil will prevent crashing.

No. Most probably not.

You need to do that.[/quote]

I do this, still it crashes at random (and thats the odd duck… it happens random)

Also, how do you make sure the action event is finished when the user closed/quited the app?

It might seem to be random, and not anymore when you finally have figured out why it crashes…

A method or function – also from a timer – will always finish before the application is teared down by the OS.

[quote=360761:@Christoph De Vocht]I do this, still it crashes at random (and thats the odd duck… it happens random)

Also, how do you make sure the action event is finished when the user closed/quited the app?[/quote]

You should save the crash report. Without it, I would have never been able with Eli and Jean-Paul’s help to find where it came from.

AFAIK nothing executes after the crash. In my case, since the app saved everything in CancelClose, it did not save anything when it crashed.

In a timer’s Action event one really has to test for each object to be Nil before accessing it.

What you also can do is set a flag in App, which in CancelClose is set to True if the app will close (meaning after you have asked the user). Then in the timer the first line always checks on this flag and returns immediately when it is True.

Here is the latest cash report

Process: Works [934]
Path: /Users/USER/Desktop/Works.app/Contents/MacOS/Works
Identifier: com.osbytes.Works
Version: 0.9.9 (0.9.9)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Works [934]
User ID: 501

Date/Time: 2017-11-16 21:10:50.509 +0100
OS Version: Mac OS X 10.13.1 (17B48)
Report Version: 12
Bridge OS Version: 3.0 (14Y661)
Anonymous UUID: A4FF4BB0-E235-4B78-028B-0BD067DCBCA0

Time Awake Since Boot: 3100 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

VM Regions Near 0x18:
–>
__TEXT 0000000105a01000-0000000107616000 [ 28.1M] r-x/rwx SM=COW s [/Users/christophedevocht/Desktop/Works.app/Contents/MacOS/Works]

Application Specific Information:
objc_msgSend() selector name: release

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff5d9d8e9d objc_msgSend + 29
1 com.apple.Foundation 0x00007fff39201ec2 empty + 58
2 com.apple.Foundation 0x00007fff390db642 -[NSConcreteMapTable dealloc] + 50
3 libobjc.A.dylib 0x00007fff5d9e0db4 objc_object::sidetable_release(bool) + 266
4 com.apple.Foundation 0x00007fff390e5c6f -[NSISEngine dealloc] + 468
5 libobjc.A.dylib 0x00007fff5d9e0db4 objc_object::sidetable_release(bool) + 266
6 com.apple.AppKit 0x00007fff347cc2a5 discardEngineRecursive + 826
7 com.apple.AppKit 0x00007fff34858f42 -[NSWindow dealloc] + 489
8 com.apple.CoreFoundation 0x00007fff3709784e cow_cleanup + 126
9 com.apple.CoreFoundation 0x00007fff36f96eed -[__NSArrayM dealloc] + 45
10 libobjc.A.dylib 0x00007fff5d9e0db4 objc_object::sidetable_release(bool) + 266
11 com.apple.AppKit 0x00007fff348a5c33 -[NSWindowController dealloc] + 247
12 com.xojo.XojoFramework 0x0000000107f58e18 0x107cc3000 + 2711064
13 libobjc.A.dylib 0x00007fff5d9e0db4 objc_object::sidetable_release(bool) + 266
14 com.apple.AppKit 0x00007fff3461a19c -[NSWindowController release] + 154
15 libobjc.A.dylib 0x00007fff5d9dc087 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 817
16 com.apple.CoreFoundation 0x00007fff36fae856 _CFAutoreleasePoolPop + 22
17 com.apple.Foundation 0x00007fff39093e75 -[NSAutoreleasePool drain] + 144
18 com.apple.AppKit 0x00007fff34600891 -[NSApplication run] + 860
19 com.xojo.XojoFramework 0x0000000107f124af RuntimeRun + 40
20 com.osbytes.ffworks 0x0000000105b08083 REALbasic._RuntimeRun + 19
21 com.osbytes.ffworks 0x000000010743bf9e _Main + 478
22 com.osbytes.ffworks 0x0000000107439a63 main + 19
23 libdyld.dylib 0x00007fff5e5d5145 start + 1

Binary Images:
0x105a01000 - 0x107615ff7 +com.osbytes.works (0.9.9 - 0.9.9) <5216A205-1BA6-3468-B441-BD931FA3B4E7> /Users/USER/Desktop/Works.app/Contents/MacOS/Works
0x107cc3000 - 0x10805dfff +com.xojo.XojoFramework (1.0 - 2) /Users/USER/Desktop/Works.app/Contents/Frameworks/XojoFramework.framework/Versions/A/XojoFramework
0x109ee2000 - 0x109eefff7 +AppearancePakCocoa.dylib (0) /Users/USER/Desktop/Works.app/Contents/Frameworks/AppearancePakCocoa.dylib
0x109efa000 - 0x109f52fff +Crypto.dylib (0) <01760C44-45E7-35D4-A197-9E7EB749DF68> /Users/USER/Desktop/Works.app/Contents/Frameworks/Crypto.dylib
0x109f67000 - 0x109f6effb +GUIKitCocoa.dylib (0) <9A40F849-3645-334A-BCAD-231D7D9D3B3D> /Users/USER/Desktop/Works.app/Contents/Frameworks/GUIKitCocoa.dylib
0x109f76000 - 0x109f7effb +HTMLViewerCocoa.dylib (0) <7B747A1F-7D9C-3BE8-B1B6-94278C130806> /Users/USER/Desktop/Works.app/Contents/Frameworks/HTMLViewerCocoa.dylib
0x109f87000 - 0x109f88ff7 +InternetEncodings.dylib (0) <547329A2-12B3-36F2-943D-D75DEC6E86E1> /Users/USER/Desktop/Works.app/Contents/Frameworks/InternetEncodings.dylib
0x109f8d000 - 0x109fe2fff +RegEx.dylib (0) /Users/USER/Desktop/Works.app/Contents/Frameworks/RegEx.dylib
0x109fe9000 - 0x109fecffb +Shell.dylib (0) <15E1D2F9-479E-3C01-9187-34D9B9D577CC> /Users/USER/Desktop/Works.app/Contents/Frameworks/Shell.dylib
0x109ff2000 - 0x10a016fff +MBS_MacBase_NSAttributedString_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSAttributedString_Plugin_19487.dylib
0x10a02c000 - 0x10a03afff +MBS_MacBase_NSCoder_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSCoder_Plugin_19487.dylib
0x10a045000 - 0x10a05ffff +MBS_MacBase_NSColor_Plugin_19487.dylib (17.5 - 17.5) <50110F7F-D9C8-31F1-B46A-A6D38B7BC102> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSColor_Plugin_19487.dylib
0x10a06e000 - 0x10a07dff7 +MBS_MacBase_NSDate_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSDate_Plugin_19487.dylib
0x10a087000 - 0x10a0a2fff +MBS_MacBase_NSFont_Plugin_19487.dylib (17.5 - 17.5) <25DD52F2-E55A-3564-9E19-0EC672C6B260> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSFont_Plugin_19487.dylib
0x10a0b2000 - 0x10a0e5ff7 +MBS_MacBase_NSImage_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSImage_Plugin_19487.dylib
0x10a100000 - 0x10a118fff +MBS_MacBase_NSLocale_Plugin_19487.dylib (17.5 - 17.5) <93FD5685-1CF1-36CD-9A79-2DB175C048C4> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSLocale_Plugin_19487.dylib
0x10a127000 - 0x10a133fff +MBS_MacBase_NSNotification_Plugin_19487.dylib (17.5 - 17.5) <752422EC-ACF3-3056-B306-6A47F5FD325F> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSNotification_Plugin_19487.dylib
0x10a13d000 - 0x10a14bfff +MBS_MacBase_NSPasteBoard_Plugin_19487.dylib (17.5 - 17.5) <73F10E20-43A3-3389-8437-AC3F0EB42DEB> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSPasteBoard_Plugin_19487.dylib
0x10a158000 - 0x10a15ffff +MBS_MacBase_NSScreen_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSScreen_Plugin_19487.dylib
0x10a167000 - 0x10a182fff +MBS_MacBase_NSURLRequest_Plugin_19487.dylib (17.5 - 17.5) <15C299A6-A1C9-3A4A-887C-45ADAF3D2C39> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSURLRequest_Plugin_19487.dylib
0x10a192000 - 0x10a1f8ff7 +MBS_MacBase_NSView_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacBase_NSView_Plugin_19487.dylib
0x10a228000 - 0x10a24ffff +MBS_MacCG_CG_Plugin_19487.dylib (17.5 - 17.5) /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacCG_CG_Plugin_19487.dylib
0x10a26b000 - 0x10a272ff7 +MBS_MacCG_CGGeometry_Plugin_19487.dylib (17.5 - 17.5) <579D37BA-EBAA-33E8-A796-9FDB48E38A19> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacCG_CGGeometry_Plugin_19487.dylib
0x10a27c000 - 0x10a296ff7 +MBS_MacCG_CGImageIO_Plugin_19487.dylib (17.5 - 17.5) <29922097-2BE4-3604-A91B-0069D4F98220> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_MacCG_CGImageIO_Plugin_19487.dylib
0x10a2b2000 - 0x10a2bbfff +MBS_Main_NSAffineTransform_Plugin_19487.dylib (17.5 - 17.5) <2F7D5596-7DE3-33B6-989B-10975D48DBBE> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_Main_NSAffineTransform_Plugin_19487.dylib
0x10a2c3000 - 0x10a2e9fff +MBS_Main_NSBase_Plugin_19487.dylib (17.5 - 17.5) <8721F8CB-CCC1-3EAF-8565-38290084978E> /Users/USER/Desktop/Works.app/Contents/Frameworks/MBS_Main_NSBase_Plugin_19487.dylib

Ouch, ouch, ouch. I thought I had eradicated the crash, and sure enough, it is back. It does not seem to be just the same as before, though.

Crash 20171122.rtf

Process:               Check Writer III+.debug [5970]
Path:                  /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/MacOS/Check Writer III+.debug
Identifier:            com.matchsoftware.checkwriterIIIplus
Version:               3.52 (3.5.2.3.1)
Code Type:             X86 (Native)
Parent Process:        ??? [1]
Responsible:           Check Writer III+.debug [5970]
User ID:               501

Date/Time:             2017-11-22 19:28:35.100 +0100
OS Version:            Mac OS X 10.13.1 (17B48)
Report Version:        12
Anonymous UUID:        C5F52A55-4390-AC96-F8CE-82D799D3AA47

Sleep/Wake UUID:       F8843D76-DB81-432D-99E6-622D362D9F52

Time Awake Since Boot: 31000 seconds
Time Since Wake:       9600 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000050a44589
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x50a44589:
    CoreServices           000000001bc2a000-000000001c854000 [ 12.2M] rw-/rwx SM=COW  
--> 
    Submap                 0000000090000000-00000000a7800000 [376.0M] r--/rwx SM=SHM  machine-wide VM submap

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ???                           	0x50a44589 0 + 1352942985
1   XojoFramework                 	0x00e38922 0xc48000 + 2033954
2   XojoFramework                 	0x00e391f7 0xc48000 + 2036215
3   XojoFramework                 	0x00c9db58 0xc48000 + 351064
4   com.apple.AppKit              	0x91477872 -[NSTrackingArea _dispatchMouseEntered:] + 209
5   com.apple.AppKit              	0x9147779b -[NSTrackingArea _mouseEntered:] + 66
6   com.apple.AppKit              	0x91ad53a0 -[NSApplication(NSEvent) sendEvent:] + 3284
7   XojoFramework                 	0x00c8a0e6 0xc48000 + 270566
8   XojoFramework                 	0x00c8a122 0xc48000 + 270626
9   com.matchsoftware.checkwriterIIIplus	0x0017feef Delegate.Invoke%% + 34
10  com.matchsoftware.checkwriterIIIplus	0x0006ae48 Application._CallFunctionWithExceptionHandling%%o<Application>p + 248
11  XojoFramework                 	0x00df6b1a 0xc48000 + 1764122
12  XojoFramework                 	0x00c8a058 0xc48000 + 270424
13  com.apple.AppKit              	0x9135a32c -[NSApplication run] + 838
14  XojoFramework                 	0x00df6bba 0xc48000 + 1764282
15  XojoFramework                 	0x00df4d94 RuntimeRun + 49
16  com.matchsoftware.checkwriterIIIplus	0x0015234e REALbasic._RuntimeRun + 34
17  com.matchsoftware.checkwriterIIIplus	0x00920167 _Main + 295
18  com.matchsoftware.checkwriterIIIplus	0x0091b7fb main + 36
19  com.matchsoftware.checkwriterIIIplus	0x0093ea9b start + 53

Thread 1:
0   libsystem_pthread.dylib       	0xa778ca48 start_wqthread + 0
1   libobjc.A.dylib               	0xa6a568fa objc_object::sidetable_release(bool) + 14

Thread 2:
0   libsystem_pthread.dylib       	0xa778ca48 start_wqthread + 0
1   com.matchsoftware.checkwriterIIIplus	0x001e0021 NSImageMBS.!NSImageNameDotMac%s% + 20

Thread 3:: Dispatch queue: NSCGSDisableUpdates
0   libsystem_kernel.dylib        	0xa7656d22 mach_msg_trap + 10
1   libsystem_kernel.dylib        	0xa765635f mach_msg + 47
2   com.apple.SkyLight            	0xa47d5fdb CGSUpdateManager::enable_updates_common() + 507
3   com.apple.SkyLight            	0xa47c8ae3 CGSUpdateManager::enable_update(unsigned long long) + 381
4   com.apple.SkyLight            	0xa47d634e SLSReenableUpdateToken + 59
5   com.apple.AppKit              	0x91daddf0 ___disable_updates_sync_block_invoke_2.102 + 26
6   libdispatch.dylib             	0xa74d6e81 _dispatch_call_block_and_release + 15
7   libdispatch.dylib             	0xa74cf69d _dispatch_client_callout + 50
8   libdispatch.dylib             	0xa74e4385 _dispatch_queue_serial_drain + 601
9   libdispatch.dylib             	0xa74d69d9 _dispatch_queue_invoke + 307
10  libdispatch.dylib             	0xa74e5195 _dispatch_root_queue_drain_deferred_wlh + 347
11  libdispatch.dylib             	0xa74e908e _dispatch_workloop_worker_thread + 742
12  libsystem_pthread.dylib       	0xa778ce4c _pthread_wqthread + 956
13  libsystem_pthread.dylib       	0xa778ca6a start_wqthread + 34

Thread 4:
0   libsystem_pthread.dylib       	0xa778ca48 start_wqthread + 0
1   ???                           	0xf3c28cb0 0 + 4089613488

Thread 5:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	0xa7656d22 mach_msg_trap + 10
1   libsystem_kernel.dylib        	0xa765635f mach_msg + 47
2   com.apple.CoreFoundation      	0x9390e858 __CFRunLoopServiceMachPort + 296
3   com.apple.CoreFoundation      	0x9390d846 __CFRunLoopRun + 2262
4   com.apple.CoreFoundation      	0x9390cc41 CFRunLoopRunSpecific + 641
5   com.apple.CoreFoundation      	0x9390c9aa CFRunLoopRunInMode + 122
6   com.apple.AppKit              	0x914950d5 _NSEventThread + 165
7   libsystem_pthread.dylib       	0xa778d50d _pthread_body + 347
8   libsystem_pthread.dylib       	0xa778d3b2 _pthread_start + 357
9   libsystem_pthread.dylib       	0xa778ca8e thread_start + 34

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00139162  ebx: 0x0118c6e0  ecx: 0x00f953e4  edx: 0x00000000
  edi: 0x01170698  esi: 0x01353c90  ebp: 0xbffff6b8  esp: 0xbffff6ac
   ss: 0x00000023  efl: 0x00210206  eip: 0x50a44589   cs: 0x0000001b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000000   gs: 0x0000000f
  cr2: 0x50a44589
  
Logical CPU:     1
Error Code:      0x00000014
Trap Number:     14


Binary Images:
    0x1000 -   0x9a7afb +com.matchsoftware.checkwriterIIIplus (3.52 - 3.5.2.3.1) <9F4934A1-D9DA-3D6B-85C4-95162254B4D7> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/MacOS/Check Writer III+.debug
  0xbbf000 -   0xc04fdf  dyld (519.2.1) <9157DBBD-7A9E-3AC4-9053-AFBFDC24F41B> /usr/lib/dyld
  0xc48000 -   0xf91fff +XojoFramework (1) <5A5DEB05-7932-3964-8190-4A6425D1724E> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/XojoFramework.framework/Versions/A/XojoFramework
 0x10f4000 -  0x10f8fff +GUIKitCocoa.dylib (???) <D0901C21-24AC-3075-9ABF-AD85A8060D53> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/GUIKitCocoa.dylib
 0x51db000 -  0x51e4ffb +AppearancePakCocoa.dylib (???) <6CBF30E8-1870-3DD2-A1C9-FBF3DABBBB12> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/AppearancePakCocoa.dylib
 0x51ec000 -  0x51f1ffb +HTMLViewerCocoa.dylib (???) <9102B79D-F727-327D-99F5-F91F609F310D> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/HTMLViewerCocoa.dylib
 0x51f8000 -  0x51f9fff +InternetEncodings.dylib (???) <1EFA8B53-F325-35EA-8305-845B16BFD70F> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/InternetEncodings.dylib
 0x5733000 -  0x5785ffb +RegEx.dylib (???) <C957EE03-D8BA-3029-83C8-F77E59A1ECFF> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/RegEx.dylib
 0x578b000 -  0x57f0ff7 +XML.dylib (???) <396485F0-E07D-3FEF-9C02-77A4BC85D00F> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/XML.dylib
 0x57fd000 -  0x581dff3 +MBS_Registration_Plugin_19070.dylib (16.3 - 16.3) <E2B70B98-9A73-30E4-ABDD-AF8257C4B568> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/MBS_Registration_Plugin_19070.dylib
 0x5827000 -  0x582cff7 +MBS_FontActivation_Plugin_19070.dylib (16.3 - 16.3) <32449412-AE68-3276-9F2F-DAEEA2A5705A> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/MBS_FontActivation_Plugin_19070.dylib
 0x5834000 -  0x5848fff +MBS_Main_Plugin_19070.dylib (16.3 - 16.3) <FCFAA555-2C85-3806-9A9B-818E462E8AD3> /Users/USER/Documents/*/Check Writer III+.debug.app/Contents/Frameworks/MBS_Main_Plugin_19070.dylib

Again :frowning:

Crash 20171123-2.rtf

The last crash log you posted was the original one. The one you posted above is a totally different crash. Mouse related - NSTrackingArea _dispatchMouseEntered:?

What I do when I have a difficult bug is to stuff the app full of

theErrorLog.logitem currentMethodName

which write what the app is doing to a session log. Perhaps the users are doing something that you don’t (they usually do that). The “check timer if something is nil” was too simple an explanation. I still think that there is something wonky between Xojo and High Sierra.

Googling for [NSTrackingArea _dispatchMouseEntered:] lists a lot of Sierra and High Sierra related crashes (Illustrator, Affinity, SequelPro, etc.). The comments are usually screen-related, like “…when I switch monitors”, or “… when I switched to full screen mode”, or “… when I accessed the menu while the app was in full screen mode”.

Michel,
I am not very advanced in this area, but a random thought. Intermittent crashes might be related to different timing of thread events. Are you saving in the main thread?
Regards,
Phil

Sorry,
meant to add - are you sure all the other threads have finished before quitting?
Phil

This is about crashes, not about exceptions. UnhandledException is not triggered, as Michel has outlined very early in this thread:

[quote=361126:@Beatrix Willius]The last crash log you posted was the original one. The one you posted above is a totally different crash. Mouse related - NSTrackingArea _dispatchMouseEntered:?

What I do when I have a difficult bug is to stuff the app full of

theErrorLog.logitem currentMethodName

which write what the app is doing to a session log. Perhaps the users are doing something that you don’t (they usually do that). The “check timer if something is nil” was too simple an explanation. I still think that there is something wonky between Xojo and High Sierra.[/quote]

Thank you Beatrix. I had fixed the first bug with the instructions of Eli, when sometimes, this new bug manifests. And this one is apparently deeper, since it does not relate to Xojo code.

I will try to put a log in each MouseEnter.

[quote=361130:@Philip Cumpston]Sorry,
meant to add - are you sure all the other threads have finished before quitting?
Phil[/quote]

Hi Phil,
I don’t use threads other than main in this app.

In deed I have code in Unhandled Exception to handle errors and report them, but again, this one does not get trapped.

The hunt continues…

I’m seeing a crash on quit for all of my smaller apps built with 17r3. In each instance, a version of this crash report occurs:

0 com.xojo.XojoFramework 0x0000000102bd6baf RuntimeObjectIsa + 76 1 com.xojo.XojoFramework 0x0000000102be8c00 RuntimeViewDestructor + 91 2 com.tolisgroup.brutalk 0x00000001027ca48b Window.__Exit%%o<Window> + 11 3 com.xojo.XojoFramework 0x0000000102bd6a31 RuntimeUnlockObject + 815 4 com.xojo.XojoFramework 0x0000000102ae2812 RuntimeView::UnifiedClose(bool) + 598 5 com.xojo.XojoFramework 0x0000000102a6fa79 0x102981000 + 977529
Not the same thing that you’ve been seeing, but still happening on the call to Quit whether from the main Window’s Close event or from the Quit menu option.

There are several feedback cases and all are ignored because it is ‘random’ and not reproducable.
It is Xojo bug for sure - but not taken seriously. I pulled my hairs for this several times. It is über frustration.

Sam posted a fix (with declare) for this some days ago.

[quote=369252:@Christoph De Vocht]There are several feedback cases and all are ignored because it is ‘random’ and not reproducable.
It is Xojo bug for sure - but not taken seriously. I pulled my hairs for this several times. It is über frustration.

Sam posted a fix (with declare) for this some days ago.[/quote]

Could I ask you where he posted the fix ? Thank you.

https://forum.xojo.com/45394-macos-64-bit-crash-after-application-exit/p1#p368799

Thanks @Christoph De Vocht and @Sam Rowlands - Placed Sam’s declare in the App.CancelQuit and the crash is alleviated.

I’m quoting it in this thread for posterity:

[code]/// — Make sure that all the user data and preferences are saved.
#if 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]