summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-11-26 19:01:52 +0100
committerwm4 <wm4@nowhere>2013-12-01 19:36:02 +0100
commiteeb37de8caaa73b6865b68cf35a2e14ffa40efac (patch)
treecd1e454802d795b79438c6e892fc51c4cbd64701
parentbbff558e6e3198bca006ef46781934442144b9d5 (diff)
downloadmpv-eeb37de8caaa73b6865b68cf35a2e14ffa40efac.tar.bz2
mpv-eeb37de8caaa73b6865b68cf35a2e14ffa40efac.tar.xz
cocoa: unlock on uninit
NSLock should be unlocked before dealloc is called on it.
-rw-r--r--video/out/cocoa_common.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 6987d5ca5d..2d38ecdc87 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -136,6 +136,7 @@ static void vo_cocoa_set_cursor_visibility(struct vo *vo, bool *visible)
void vo_cocoa_uninit(struct vo *vo)
{
+ vo_cocoa_set_current_context(vo, false);
dispatch_sync(dispatch_get_main_queue(), ^{
struct vo_cocoa_state *s = vo->cocoa;
enable_power_management(vo);
@@ -444,9 +445,10 @@ void vo_cocoa_set_current_context(struct vo *vo, bool current)
[s->gl_ctx makeCurrentContext];
} else {
+ const bool locked = !![NSOpenGLContext currentContext];
[NSOpenGLContext clearCurrentContext];
- if (!s->inside_sync_section)
+ if (!s->inside_sync_section && locked)
[s->lock unlock];
}
}