Commit c82c8073 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* make sure that the timer which is updating the stats-tab is stopped when the panel is closed

* fixed a minor memory leak (the timer wasn't released after invalidating it)
* VLCInfo is o_info_window's delegate now
parent ff47c5ee
......@@ -98,10 +98,19 @@
[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
......@@ -115,8 +124,7 @@
{
if( [o_info_window isVisible] )
{
if( o_statUpdateTimer )
[o_statUpdateTimer invalidate];
[self windowShouldClose: nil];
[o_info_window orderOut: sender];
}
else
......@@ -268,6 +276,7 @@
- (IBAction)infoCancel:(id)sender
{
[self windowShouldClose: nil];
[o_info_window orderOut: self];
}
......@@ -292,6 +301,7 @@
var_Set( p_playlist, "intf-change", val );
}
vlc_object_release( p_playlist );
[self windowShouldClose: nil];
[o_info_window orderOut: self];
}
......@@ -324,6 +334,16 @@
return NO;
}
- (BOOL)windowShouldClose:(id)sender
{
if( o_statUpdateTimer )
{
[o_statUpdateTimer invalidate];
[o_statUpdateTimer release];
}
return YES;
}
@end
@implementation VLCInfo (NSMenuValidation)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment