7176644: [macosx] Missing NSAutoreleasePool in CGLGraphicsConfig.m OGLGC_DestroyOGLGraphicsConfig

Create and drain an autorelease pool

Reviewed-by: anthony, dcherepanov
This commit is contained in:
Tomas Hurka 2012-06-13 18:33:30 +04:00 committed by Anthony Petrov
parent f6020a8e34
commit bf4e37de48

View File

@ -63,12 +63,14 @@ OGLGC_DestroyOGLGraphicsConfig(jlong pConfigInfo)
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);
}
}