]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlistinfo.m
* make sure that the timer which is updating the stats-tab is stopped when the panel...
[vlc] / modules / gui / macosx / playlistinfo.m
index 67c3fe1fbdee4b7fed039fa47c56b6a8e3d0e19a..c09b181618bb45190a279a8c0d916c41c5a03e11 100644 (file)
     [o_lost_abuffers_lbl setStringValue: _NS("Lost buffers")];
 }
 
+- (void)dealloc
+{
+    /* make that it is released in any case */
+    if ( o_statUpdateTimer )
+        [o_statUpdateTimer release];
+    [super dealloc];
+}
+
 - (IBAction)togglePlaylistInfoPanel:(id)sender
 {
     if( [o_info_window isVisible] )
     {
+        [self windowShouldClose: nil];
         [o_info_window orderOut: sender];
     }
     else
 {
     if( [o_info_window isVisible] )
     {
-        if( o_statUpdateTimer )
-            [o_statUpdateTimer invalidate];
+        [self windowShouldClose: nil];
         [o_info_window orderOut: sender];
     }
     else
 
 - (IBAction)infoCancel:(id)sender
 {
+    [self windowShouldClose: nil];
     [o_info_window orderOut: self];
 }
 
         var_Set( p_playlist, "intf-change", val );
     }
     vlc_object_release( p_playlist );
+    [self windowShouldClose: nil];
     [o_info_window orderOut: self];
 }
 
     return NO;
 }
 
+- (BOOL)windowShouldClose:(id)sender
+{
+    if( o_statUpdateTimer )
+    {
+        [o_statUpdateTimer invalidate];
+        [o_statUpdateTimer release];
+    }
+    return YES;
+}
+
 @end
 
 @implementation VLCInfo (NSMenuValidation)