From 94c23298c8685a5af556c07a458bf97061fffca9 Mon Sep 17 00:00:00 2001 From: kappa1 Date: Sat, 3 Nov 2012 18:06:08 +0000 Subject: [PATCH] Fix a native crash on startup of some applications --- src/native/macosx/org_lwjgl_opengl_Display.m | 6 +++--- .../macosx/org_lwjgl_opengl_MacOSXContextImplementation.m | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/native/macosx/org_lwjgl_opengl_Display.m b/src/native/macosx/org_lwjgl_opengl_Display.m index e121110b..5a945b95 100644 --- a/src/native/macosx/org_lwjgl_opengl_Display.m +++ b/src/native/macosx/org_lwjgl_opengl_Display.m @@ -497,7 +497,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nHideUI(JNIEnv *env, } MacOSXWindowInfo *window_info = (MacOSXWindowInfo *)(*env)->GetDirectBufferAddress(env, window_handle); - if(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) { + //if(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) { /*NSApplicationPresentationOptions options = NSApplicationPresentationDefault; if (hide == JNI_TRUE) { options = NSApplicationPresentationFullScreen; // this requires OS X 10.7+ to compile @@ -509,11 +509,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nHideUI(JNIEnv *env, if (window_info->window != nil) { [[NSApplication sharedApplication] setPresentationOptions:options]; }*/ - } else { + //} else { if (hide == JNI_TRUE) { SetSystemUIMode(kUIModeContentSuppressed, 0); } else { SetSystemUIMode(kUIModeNormal, 0); } - } + //} } diff --git a/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m b/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m index 36d40565..2bc6c909 100644 --- a/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m +++ b/src/native/macosx/org_lwjgl_opengl_MacOSXContextImplementation.m @@ -58,7 +58,7 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCre MacOSXContext *shared_context_info; MacOSXContext *context_info; NSOpenGLContext *context; - NSOpenGLContext *shared_context; + NSOpenGLContext *shared_context = NULL; printf("nCreate\n"); jobject context_handle = newJavaManagedByteBuffer(env, sizeof(MacOSXContext)); if (context_handle == NULL) {