Re: Weird crash with Mojave, no crash on High Sierra

Markus Ruggiero

Thanks a lot, seems to have cured things. I added a line to set the window delegate to nil before [myWindow close] and things are ok now.


On 23 Nov 2019, at 19:50, Quincey Morris <quinceymorris@...> wrote:

On Nov 22, 2019, at 13:50 , Markus Ruggiero <mailinglists@...> wrote:

Anyway hopefully someone can make some sense of this.

There’s not really enough information here to really solve the problem. The overall “feel” of the crash is a memory management problem related to the various objects used alongside a NSWindow. It is more than possible that you’ve had the problem all along, and you’ve just been unlucky this hasn’t crashed earlier. It’s presumably crashing now because the timing of various parts of app termination changed, and that’s exposing the long-standing bug.

At the top of your backtrace is this:

0               0x00007fff3c3cbbd6 -[NSWindow(NSFullScreen) _didExitFullScreen] + 48

My guess is that AppKit is about to invoke the corresponding window delegate method:

but your window delegate (probably a NSWindowController) has already been deallocated.

This sort of thing is really hard to debug and fix. The easiest thing to try is to make sure your window controller sets its window’s “delegate” property to nil before it deallocates. If you’re lucky, that will solve it. If not, that might just push the crash to a different place.

Join { to automatically receive all group messages.