Mac OS X gui: Sanitize vlc object retaining/releasing.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 4 Mar 2007 00:45:10 +0000 (00:45 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 4 Mar 2007 00:45:10 +0000 (00:45 +0000)
modules/gui/macosx/controls.m
modules/gui/macosx/intf.m
modules/gui/macosx/sfilters.m

index da7f5d4..92afaf8 100644 (file)
         intf_thread_t * p_intf = VLCIntf;
         val.i_int = config_GetInt( p_intf, "key-position" );
         var_Set( p_intf, "key-pressed", val );
+        vlc_object_release( (vlc_object_t *)p_vout );
     }
 }
 
index 552ffa3..4023f48 100644 (file)
@@ -1353,6 +1353,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     [o_controls setupVarMenuItem: o_mi_screen target: (vlc_object_t *)p_vout
                              var: "video-device" selector: @selector(toggleVar:)];
+    vlc_object_release( (vlc_object_t *)p_vout );
 }
 
 - (void)setScrollField:(NSString *)o_string stopAfter:(int)timeout
@@ -1572,14 +1573,6 @@ static VLCMain *_o_sharedMainInstance = nil;
     p_intf->b_interaction = VLC_FALSE;
     var_DelCallback( p_intf, "interaction", InteractCallback, self );
 
-#define p_input p_intf->p_sys->p_input
-    if( p_input )
-    {
-        vlc_object_release( p_input );
-        p_input = NULL;
-    }
-#undef p_input
-
     /* remove global observer watching for vout device changes correctly */
     [[NSNotificationCenter defaultCenter] removeObserver: self
                                                     name: NSApplicationDidChangeScreenParametersNotification
index 19ec263..f305bb1 100644 (file)
@@ -646,8 +646,6 @@ static VLCsFilters *_o_sharedInstance = nil;
 
     free( psz_string );
 
-    vlc_object_release( p_intf );
-
     o_config_changed = YES;
 }
 @end