winemac: Make WineOpenGLContext hold a strong reference to its view.

Its superclass, NSOpenGLContext, only holds a weak reference.  The view was
sometimes being deallocated before the context was disposed of, resulting in
crashes.
This commit is contained in:
Ken Thomases 2014-01-14 01:25:08 -06:00 committed by Alexandre Julliard
parent 2963a2d4ab
commit e21192469d
1 changed files with 16 additions and 0 deletions

View File

@ -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