Commit 1261589c authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Only manipulate an NSOpenGLContext's view on the main thread.

I was seeing a crash due to an assert about manipulating it on a background thread. I can't recall where I was seeing that. I think it's new in Catalina. Signed-off-by: 's avatarChip Davis <cdavis@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c70c1056
......@@ -79,8 +79,10 @@
macdrv_set_view_backing_size((macdrv_view)self.view, view_backing);
NSView* save = self.view;
[super clearDrawable];
[super setView:save];
OnMainThread(^{
[super clearDrawable];
[super setView:save];
});
shouldClearToBlack = TRUE;
}
}
......@@ -122,7 +124,11 @@
- (void) setView:(NSView*)newView
{
NSView* oldView = [self view];
[super setView:newView];
if ([NSThread isMainThread])
[super setView:newView];
else OnMainThread(^{
[super setView:newView];
});
[newView retain];
[oldView release];
}
......@@ -130,7 +136,11 @@
- (void) clearDrawable
{
NSView* oldView = [self view];
[super clearDrawable];
if ([NSThread isMainThread])
[super clearDrawable];
else OnMainThread(^{
[super clearDrawable];
});
[oldView release];
[self wine_updateBackingSize:NULL];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment