From d590c5df17650b3790bb434fb7529df874914a09 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 15 Jan 2018 07:21:41 +0100 Subject: Bug 1299: Fix Warning when using JOGL on Mac OS X El Capitan It turned out to be a missing CATransaction, i.e. the native create/destroy commands had to be encapsulated within [CATransaction begin] and [CATransaction commit] causing the uncommitted CATransaction. --- src/nativewindow/native/macosx/OSXmisc.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nativewindow/native/macosx/OSXmisc.m b/src/nativewindow/native/macosx/OSXmisc.m index ce4a3b7ee..80ddee415 100644 --- a/src/nativewindow/native/macosx/OSXmisc.m +++ b/src/nativewindow/native/macosx/OSXmisc.m @@ -336,6 +336,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 (JNIEnv *env, jclass unused, jint x, jint y, jint width, jint height) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + [CATransaction begin]; NSRect rect = NSMakeRect(x, y, width, height); // Allocate the window @@ -365,6 +366,7 @@ NS_ENDHANDLER // [myView lockFocus]; // [myView unlockFocus]; + [CATransaction commit]; [pool release]; return (jlong) ((intptr_t) myWindow); @@ -379,9 +381,12 @@ JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_DestroyNSWindow0 (JNIEnv *env, jclass unused, jlong nsWindow) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSWindow* mWin = (NSWindow*) ((intptr_t) nsWindow); + [CATransaction begin]; + NSWindow* mWin = (NSWindow*) ((intptr_t) nsWindow); [mWin close]; // performs release! + + [CATransaction commit]; [pool release]; } -- cgit v1.2.3