Hard crash - debug help...

Hi, I have a hard crash, but debug can not force the error back… please advice: (I have no idea where to look now, I’m frustrated)

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY

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

Application Specific Information:
Calling windowShouldClose: on the delegate for the XOJWindow 0x7fa401f1c5d0

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.xojo.XojoFramework
0x0000000104143baf RuntimeObjectIsa + 76
1 com.xojo.XojoFramework
0x0000000104155c00 RuntimeViewDestructor + 91
2 no.hgtsoftware.gallerymaster
0x00000001032bf92b Window.__Exit%%o + 11
3 com.xojo.XojoFramework
0x0000000104143a31 RuntimeUnlockObject + 815
4 com.xojo.XojoFramework
0x000000010404f812 RuntimeView::UnifiedClose(bool) + 598
5 com.xojo.XojoFramework
0x0000000103fdca79 0x103eee000 + 977529
6 com.apple.AppKit
0x00007fff411208dd __19-[NSWindow __close]_block_invoke + 185
7 com.apple.AppKit
0x00007fff41120817 -[NSWindow __close] + 297
8 com.apple.AppKit
0x00007fff415c575a -[NSApplication(NSResponder) sendAction:to:from:] + 312
9 com.apple.AppKit
0x00007fff4106b933 -[NSControl sendAction:to:] + 86
10 com.apple.AppKit
0x00007fff4106b85b __26-[NSCell _sendActionFrom:]_block_invoke + 136
11 com.apple.AppKit
0x00007fff4106b761 -[NSCell _sendActionFrom:] + 183
12 com.apple.AppKit
0x00007fff410aca18 -[NSButtonCell _sendActionFrom:] + 97
13 com.apple.AppKit
0x00007fff41069fca -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2438
14 com.apple.AppKit
0x00007fff410ac75f -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 777
15 com.apple.AppKit
0x00007fff41068a64 -[NSControl mouseDown:] + 965
16 com.apple.AppKit
0x00007fff41102f1d -[_NSThemeWidget mouseDown:] + 86
17 com.apple.AppKit
0x00007fff41764959 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 5891
18 com.apple.AppKit
0x00007fff417615b0 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2359
19 com.apple.AppKit
0x00007fff4176085c -[NSWindow(NSEventRouting) sendEvent:] + 497
20 com.xojo.XojoFramework
0x0000000103fd157c 0x103eee000 + 931196
21 com.apple.AppKit
0x00007fff415c1617 -[NSApplication(NSEvent) sendEvent:] + 307
22 com.xojo.XojoFramework
0x0000000103fc0f9d 0x103eee000 + 864157
23 no.hgtsoftware.gallerymaster
0x0000000103306f45 Application._CallFunctionWithExceptionHandling%%op + 181
24 com.xojo.XojoFramework
0x00000001041414df CallFunctionWithExceptionHandling(void (*)()) + 262
25 com.xojo.XojoFramework
0x0000000103fc0f18 0x103eee000 + 864024
26 com.apple.AppKit
0x00007fff40e22d9d -[NSApplication run] + 812
27 com.xojo.XojoFramework
0x000000010413f80b RuntimeRun + 40
28 no.hgtsoftware.gallerymaster
0x00000001033a1cd3 REALbasic._RuntimeRun + 19
29 no.hgtsoftware.gallerymaster
0x0000000103abafc8 _Main + 536
30 no.hgtsoftware.gallerymaster
0x0000000103aba703 main + 19
31 libdyld.dylib
0x00007fff6b15e115 start + 1

Here is the interesting part:

0x00007fff41069fca -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2438
14 com.apple.AppKit
0x00007fff410ac75f -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 777
15 com.apple.AppKit
0x00007fff41068a64 -[NSControl mouseDown:] + 965

Check what you do on mouse down. I seem to remember that this was already posted here on the forum. For instance here:

https://forum.xojo.com/45205-apps-crashes-5-out-of-10-when-quiting/0

Thanx, but I use MouseDown all over the place. Do you manage to se what window/container the mouseDown is from ?

You do this as always: you pepper your code with logging and currentMethodName in the mouse down until you find the culprit.