summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-11-26 19:01:52 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-11-26 20:50:35 +0100
commit6ead6aa005f1c78a117bde58e48f106cfd1e9806 (patch)
treee1df2694aca727056c41aa37f90a694324a8dd5c /video/out
parent4c634762b43e8f40739ebd0605c05cb1ea424c81 (diff)
downloadmpv-6ead6aa005f1c78a117bde58e48f106cfd1e9806.tar.bz2
mpv-6ead6aa005f1c78a117bde58e48f106cfd1e9806.tar.xz
cocoa: unlock on uninit
NSLock should be unlocked before dealloc is called on it.
Diffstat (limited to 'video/out')
-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 3d1f8868f1..fb6187a989 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];
}
}