fix crash related to mouse being dragging whilst Display is destroyed.

This commit is contained in:
kappaOne 2013-02-03 16:39:02 +00:00
parent 2d43265d10
commit 65beebb379
1 changed files with 3 additions and 6 deletions

View File

@ -252,7 +252,7 @@ static NSAutoreleasePool *pool;
- (void)mouseDragged:(NSEvent *)event {
JNIEnv *env = attachCurrentThread();
if (env == nil || event == nil || _parent == nil) {
if (env == nil || event == nil || _parent == nil || _parent->jmouse == nil) {
return;
}
long time = [event timestamp] * 1000000000;
@ -264,7 +264,7 @@ static NSAutoreleasePool *pool;
- (void)rightMouseDragged:(NSEvent *)event {
JNIEnv *env = attachCurrentThread();
if (env == nil || event == nil || _parent == nil) {
if (env == nil || event == nil || _parent == nil || _parent->jmouse == nil) {
return;
}
long time = [event timestamp] * 1000000000;
@ -276,7 +276,7 @@ static NSAutoreleasePool *pool;
- (void)otherMouseDragged:(NSEvent *)event {
JNIEnv *env = attachCurrentThread();
if (env == nil || event == nil || _parent == nil) {
if (env == nil || event == nil || _parent == nil || _parent->jmouse == nil) {
return;
}
long time = [event timestamp] * 1000000000;
@ -556,9 +556,6 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow(JNIE
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nDestroyWindow(JNIEnv *env, jobject this, jobject window_handle) {
MacOSXWindowInfo *window_info = (MacOSXWindowInfo *)(*env)->GetDirectBufferAddress(env, window_handle);
// remove parent to stop receiving input
[window_info->view setParent:nil];
if (window_info->fullscreen) {
[window_info->view exitFullScreenModeWithOptions: nil];
}