Fix memory leak introduced by last patch.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26441 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-04-08 08:02:59 +00:00
parent 3811a82a38
commit 67c69e63da
2 changed files with 16 additions and 3 deletions

View file

@ -32,6 +32,11 @@
#include "AppKit/NSOpenGL.h"
#include "AppKit/NSOpenGLView.h"
// Declare a private method of NSView
@interface NSView (Private)
- (void) _lockFocusInContext: (NSGraphicsContext *)ctxt inRect: (NSRect)rect;
@end
/**
<unit>
<heading>NSOpenGLView</heading>
@ -118,9 +123,12 @@ static NSOpenGLPixelFormatAttribute attrs[] =
{
if (glcontext == nil)
{
[self setOpenGLContext:
[[NSOpenGLContext alloc] initWithFormat: pixel_format
shareContext: nil]];
NSOpenGLContext *context = [[NSOpenGLContext alloc]
initWithFormat: pixel_format
shareContext: nil];
[self setOpenGLContext: context];
RELEASE(context);
}
return glcontext;
}