diff --git a/ChangeLog b/ChangeLog index 9034c5ff5..719aec66b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-08 Fred Kiefer + + * Source/NSOpenGLView.m (-openGLContext): Fix memory leak + introduced by last change. + 2008-04-08 Fred Kiefer * Source/NSBezierPath.m (+drawPackedGlyphs:atPoint:): Use fill diff --git a/Source/NSOpenGLView.m b/Source/NSOpenGLView.m index 03bd5e676..6d939348a 100644 --- a/Source/NSOpenGLView.m +++ b/Source/NSOpenGLView.m @@ -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 + /** NSOpenGLView @@ -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; }