[PATCH v2] winemac: Only call -[NSOpenGLContext update] from the main thread.

Ken Thomases ken at codeweavers.com
Wed Mar 11 14:55:53 CDT 2020


Signed-off-by: Ken Thomases <ken at codeweavers.com>
---
Supersedes 180672.  I've had this patch locally and Sven's submission prompted
me to send it.

v2: Since macdrv_update_opengl_context() is never called from the main thread,
there's no need to check if it's the main thread.

 dlls/winemac.drv/cocoa_opengl.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m
index e60b0b388b8..80a766cbda5 100644
--- a/dlls/winemac.drv/cocoa_opengl.m
+++ b/dlls/winemac.drv/cocoa_opengl.m
@@ -359,8 +359,9 @@ void macdrv_update_opengl_context(macdrv_opengl_context c)
                 [context clearDrawableLeavingSurfaceOnScreen];
                 context.view = view;
             }
-            else
+            else OnMainThread(^{
                 [context update];
+            });
             [context resetSurfaceIfBackingSizeChanged];
         }
     }
-- 
2.21.0




More information about the wine-devel mailing list