Commit 7d3d47c4 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* allocate o_extended only if requested by the user (that's dirty, but...

* allocate o_extended only if requested by the user (that's dirty, but prevents the access of freed objects while terminating) and save the extended-prefs as early as possible in the termination-process (directly after the vout and playlist shut down)
parent 8546371b
...@@ -301,7 +301,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -301,7 +301,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_prefs = nil; o_prefs = nil;
o_open = [[VLCOpen alloc] init]; o_open = [[VLCOpen alloc] init];
o_wizard = [[VLCWizard alloc] init]; o_wizard = [[VLCWizard alloc] init];
o_extended = [[VLCExtended alloc] init]; o_extended = nil;
o_bookmarks = [[VLCBookmarks alloc] init]; o_bookmarks = [[VLCBookmarks alloc] init];
/*o_update = [[VLCUpdate alloc] init];*/ /*o_update = [[VLCUpdate alloc] init];*/
...@@ -1365,6 +1365,35 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1365,6 +1365,35 @@ static VLCMain *_o_sharedMainInstance = nil;
} }
msleep( 500000 ); msleep( 500000 );
/* save the prefs if they were changed in the extended panel */
if (o_extended && [o_extended getConfigChanged])
{
[o_extended savePrefs];
}
/* release some other objects here, because it isn't sure whether dealloc
* will be called later on -- FK (10/6/05) */
if ( o_about )
[o_about release];
if ( o_prefs )
[o_prefs release];
if ( o_open )
[o_open release];
if ( o_extended )
{
[o_extended collapsAll];
[o_extended release];
}
if ( o_bookmarks )
[o_bookmarks release];
if ( o_wizard )
[o_wizard release];
if( o_img_pause_pressed != nil ) if( o_img_pause_pressed != nil )
{ {
[o_img_pause_pressed release]; [o_img_pause_pressed release];
...@@ -1402,35 +1431,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1402,35 +1431,6 @@ static VLCMain *_o_sharedMainInstance = nil;
o_msg_lock = nil; o_msg_lock = nil;
} }
/* save the prefs if they were changed in the extended panel */
if (o_extended && [o_extended getConfigChanged])
{
[o_extended savePrefs];
}
/* release some other objects here, because it isn't sure whether dealloc
* will be called later on -- FK (10/6/05) */
if ( o_about )
[o_about release];
if ( o_prefs )
[o_prefs release];
if ( o_open )
[o_open release];
if ( o_extended )
{
[o_extended collapsAll];
[o_extended release];
}
if ( o_bookmarks )
[o_bookmarks release];
if ( o_wizard )
[o_wizard release];
/* write cached user defaults to disk */ /* write cached user defaults to disk */
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
...@@ -1513,6 +1513,10 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1513,6 +1513,10 @@ static VLCMain *_o_sharedMainInstance = nil;
- (IBAction)showExtended:(id)sender - (IBAction)showExtended:(id)sender
{ {
if ( o_extended == nil )
{
o_extended = [[VLCExtended alloc] init];
}
if (!nib_extended_loaded) if (!nib_extended_loaded)
{ {
nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self]; nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self];
......
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