Don't crash when using libgmalloc on Leopard (closes #1501)
authorFelix Paul Kühne <fkuehne@videolan.org>
Wed, 26 Mar 2008 11:25:40 +0000 (12:25 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Wed, 26 Mar 2008 11:25:40 +0000 (12:25 +0100)
Patch by Drew Yao. Thanks and sorry for the long time it took this simple fix to be committed!

modules/gui/macosx/intf.m

index 9fdfed3..7a98a5c 100644 (file)
@@ -409,11 +409,13 @@ static VLCMain *_o_sharedMainInstance = nil;
 
 - (id)init
 {
-    if( _o_sharedMainInstance) {
+    if( _o_sharedMainInstance) 
+    {
         [self dealloc];
-    } else {
+        return _o_sharedMainInstance;
+    } 
+    else
         _o_sharedMainInstance = [super init];
-    }
 
     o_about = [[VLAboutBox alloc] init];
     o_prefs = [[VLCPrefs alloc] init];