]> git.sesse.net Git - vlc/commitdiff
macosx: Fix toolbar usage in simple_prefs, and fix a double release on toolbar.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 14 Aug 2008 16:35:27 +0000 (18:35 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 14 Aug 2008 16:42:50 +0000 (18:42 +0200)
Fix a crash when exiting with simple pref open.

modules/gui/macosx/simple_prefs.h
modules/gui/macosx/simple_prefs.m

index b37adcb2a399decac415d54110c42f24d2178c07..20c091886cc4624853fe816883e585784218aae2 100644 (file)
     BOOL b_hotkeyChanged;
     id o_currentlyShownCategoryView;
 
-    NSToolbar *o_sprefs_toolbar;
     NSOpenPanel *o_selectFolderPanel;
     NSArray *o_hotkeyDescriptions;
     NSArray *o_hotkeysNonUseableKeys;
index 7a388f393f241ec7477a334308c4ff49b15b75aa..31aa5abce959dc8f9df18e72990055978f987da5 100644 (file)
@@ -59,7 +59,6 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 - (void)dealloc
 {
     [o_currentlyShownCategoryView release];
-    [o_sprefs_toolbar release];
 
     [o_hotkeySettings release];
     [o_hotkeyDescriptions release];
@@ -96,7 +95,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     [self initStrings];
     
     /* setup the toolbar */
-    o_sprefs_toolbar = [[[NSToolbar alloc] initWithIdentifier: VLCSPrefsToolbarIdentifier] autorelease];
+    NSToolbar * o_sprefs_toolbar = [[[NSToolbar alloc] initWithIdentifier: VLCSPrefsToolbarIdentifier] autorelease];
     [o_sprefs_toolbar setAllowsUserCustomization: NO];
     [o_sprefs_toolbar setAutosavesConfiguration: NO];
     [o_sprefs_toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
@@ -596,9 +595,9 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 - (void)showSimplePrefs
 {
     /* we want to show the interface settings, if no category was chosen */
-    if( [o_sprefs_toolbar selectedItemIdentifier] == nil )
+    if( [[o_sprefs_win toolbar] selectedItemIdentifier] == nil )
     {
-        [o_sprefs_toolbar setSelectedItemIdentifier: VLCIntfSettingToolbarIdentifier];
+        [[o_sprefs_win toolbar] setSelectedItemIdentifier: VLCIntfSettingToolbarIdentifier];
         [self showInterfaceSettings];
     }