diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m index 5ec5688121e..32d182f3c56 100644 --- a/dlls/winemac.drv/cocoa_opengl.m +++ b/dlls/winemac.drv/cocoa_opengl.m @@ -35,10 +35,26 @@ @implementation WineOpenGLContext - (void) dealloc { + [[self view] release]; [latentView release]; [super dealloc]; } + - (void) setView:(NSView*)newView + { + NSView* oldView = [self view]; + [super setView:newView]; + [newView retain]; + [oldView release]; + } + + - (void) clearDrawable + { + NSView* oldView = [self view]; + [super clearDrawable]; + [oldView release]; + } + /* On at least some versions of Mac OS X, -[NSOpenGLContext clearDrawable] has the undesirable side effect of ordering the view's GL surface off-screen. This isn't done when just changing the context's view to a different view (which I would