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:
parent
2963a2d4ab
commit
e21192469d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue