@@ -112,12 +112,15 @@ NSWindow *child = (NSWindow*)[children objectAtIndex:i]; [child close]; } // Call the notification method - GET_MAIN_JENV; + assert(pthread_main_np() == 1); + JNIEnv *env = jEnv; + if (env != NULL) { (*env)->CallVoidMethod(env, self->jWindow, jWindowNotifyDestroy); + } } - (void)windowWillMove:(NSNotification *)notification { //NSLog(@"windowWillMove");