* 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
This commit is contained in:
Felix Paul Kühne 2006-03-05 16:41:18 +00:00
parent ff47c5ee4f
commit c82c807387
2 changed files with 22 additions and 2 deletions

View File

@ -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)