+ // If we're not the main thread, don't install the idle handler
+ if(m_cocoaMainThread != [NSThread currentThread])
+ {
+ wxLogDebug("Attempt to install idle handler from secondary thread");
+ return;
+ }
+ // If we're supposed to be stopping, don't add more idle events
+ if(![m_cocoaApp isRunning])
+ return;