From ac275a823d9c86168dd7ee39bcc7e3aa1b4830dc Mon Sep 17 00:00:00 2001 From: der richter Date: Fri, 16 Feb 2024 23:54:52 +0100 Subject: cocoa-cb: lock CGLContext on uninit and manual redraw this fixes a crash on quit, when a CATransaction from a system owned thread/event is happening at the same time. locking the context synchronises these access and prevents the race condition. the draw operation induced by any display call from the CAOpenGLLayer doesn't need that lock, since the display function already does lock that current context. Fixes #11681 --- video/out/cocoa_cb_common.swift | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/out/cocoa_cb_common.swift') diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift index 4655cabf9b..094dab1a55 100644 --- a/video/out/cocoa_cb_common.swift +++ b/video/out/cocoa_cb_common.swift @@ -209,7 +209,9 @@ class CocoaCB: Common { uninit() uninitCommon() + layer?.lockCglContext() libmpv.deinitRender() + layer?.unlockCglContext() libmpv.deinitMPV(destroy) } -- cgit v1.2.3