[vlc-devel] commit: macosx: NSScreen dealloc is not only called at end of execution of course. ( Derk-Jan Hartman )

git version control git at videolan.org
Mon Jun 22 19:59:17 CEST 2009


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Mon Jun 22 19:55:12 2009 +0200| [b5feb899d6047e2371ce18fe7d73c51fe270e2a1] | committer: Derk-Jan Hartman 

macosx: NSScreen dealloc is not only called at end of execution of course.

This fixes the NSScreen crash, which could be accurately reproduced by following the steps in #2880.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b5feb899d6047e2371ce18fe7d73c51fe270e2a1
---

 modules/gui/macosx/misc.m |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index fe57179..c9a4c4a 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -129,13 +129,14 @@ static NSMutableArray *blackoutWindows = NULL;
 + (void)load
 {
     /* init our fake object attribute */
-    blackoutWindows = [[NSMutableArray alloc] initWithCapacity:1];
+    if( !blackoutWindows )
+        blackoutWindows = [NSMutableArray arrayWithCapacity:1];
 }
 
 - (void)dealloc
 {
+    [blackoutWindows makeObjectsPerformSelector:@selector(close)];
     [blackoutWindows removeAllObjects];
-    [blackoutWindows release];
     [super dealloc];
 }
 




More information about the vlc-devel mailing list