diff options
author | der richter <der.richter@gmx.de> | 2024-02-16 23:54:52 +0100 |
---|---|---|
committer | der richter <der.richter@gmx.de> | 2024-02-18 17:25:05 +0100 |
commit | ac275a823d9c86168dd7ee39bcc7e3aa1b4830dc (patch) | |
tree | af3080a891c02ca7b2683a667b84e04b5b3c387c /video/out/cocoa_cb_common.swift | |
parent | 3fd840f85dc52da99feee0c682e22f5867f8c8cb (diff) | |
download | mpv-ac275a823d9c86168dd7ee39bcc7e3aa1b4830dc.tar.bz2 mpv-ac275a823d9c86168dd7ee39bcc7e3aa1b4830dc.tar.xz |
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
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r-- | video/out/cocoa_cb_common.swift | 2 |
1 files changed, 2 insertions, 0 deletions
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) } |