From 58f62891fa99c8d4d0ebfc9c719134af753366e2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 9 Oct 2014 21:08:10 +0200 Subject: cocoa: fix 'uninitalized' access I think this doesn't make a difference, since in Objective-C nil responds as a NullObject, but better not depend on this crappy language feature. --- video/out/cocoa_common.m | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 7eabad53ba..d704706501 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -184,15 +184,13 @@ void vo_cocoa_uninit(struct vo *vo) [s->video release]; - // XXX: It looks like there are some circular retain cycles for the - // video view / video window that cause them to not be deallocated, - // This is a workaround to make the fullscreen window be released, - // but the retain cycle problems should be investigated. - if ([s->view isInFullScreenMode]) - [[s->view window] release]; - - [s->window release]; - s->window = nil; + if (!s->embedded) { + if ([s->view isInFullScreenMode]) + [[s->view window] release]; + + [s->window release]; + s->window = nil; + } }); } -- cgit v1.2.3