7176644: [macosx] Missing NSAutoreleasePool in CGLGraphicsConfig.m OGLGC_DestroyOGLGraphicsConfig
authoranthony
Wed, 13 Jun 2012 18:33:30 +0400
changeset 13002 4a1b60b6782a
parent 13001 afa8e122dcce
child 13003 a30d38cef987
7176644: [macosx] Missing NSAutoreleasePool in CGLGraphicsConfig.m OGLGC_DestroyOGLGraphicsConfig Summary: Create and drain an autorelease pool Reviewed-by: anthony, dcherepanov Contributed-by: Tomas Hurka <tomas.hurka@googlemail.com>
jdk/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m
--- a/jdk/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m	Mon Jun 11 10:52:31 2012 +0800
+++ b/jdk/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m	Wed Jun 13 18:33:30 2012 +0400
@@ -63,12 +63,14 @@
 
         CGLCtxInfo *ctxinfo = (CGLCtxInfo *)oglc->ctxInfo;
         if (ctxinfo != NULL) {
+            NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];        
             [NSOpenGLContext clearCurrentContext];
             [ctxinfo->context clearDrawable];
             [ctxinfo->context release];
             if (ctxinfo->scratchSurface != 0) {
                 [ctxinfo->scratchSurface release];
             }
+            [pool drain];
             free(ctxinfo);
         }
     }