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>
--- 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);
}
}