So I thought it might be a race condition of some sort, so I enclosed the apploopnr checks with an @synchronize, like so: 3636 @synchronized([NSApp class]) { 3637 if (++apploopnr != 1) 3638 { 3639 emacs_abort (); 3640 } 3641 [NSApp run]; 3642 --apploopnr; 3643 } Sadly, still crashes. I may have done the synchronize incorrectly, I am not really a cocoa / objc programmer.