remove nsview on main thread to avoid thread issues

This commit is contained in:
kappaOne 2013-02-03 20:54:27 +00:00
parent f6a2bc8327
commit c57c27abaf
1 changed files with 4 additions and 4 deletions

View File

@ -349,10 +349,10 @@ static NSAutoreleasePool *pool;
mouseLocation = [self convertPoint:mouseLocation fromView:nil];
if (NSPointInRect(mouseLocation, [self bounds])) {
[self mouseEntered: nil];
[self mouseEntered:nil];
}
else {
[self mouseExited: nil];
[self mouseExited:nil];
}
}
@ -578,8 +578,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nDestroyWindow(JNIEnv
[window_info->window close];
}
// release the nsview and remove it from any parent nsview
[window_info->view removeFromSuperviewWithoutNeedingDisplay];
// release the nsview and remove it from any parent nsview using main thread
[window_info->view performSelectorOnMainThread:@selector(removeFromSuperviewWithoutNeedingDisplay) withObject:window_info->view waitUntilDone:YES];
}
}