[vlc-commits] macosx: fix crash when displaying the Media Information panel with disabled local stats

Felix Paul Kühne git at videolan.org
Wed Nov 14 12:28:35 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Nov 14 12:28:33 2012 +0100| [a44da88b77a1fe47f5e49c11106261d8b50315f8] | committer: Felix Paul Kühne

macosx: fix crash when displaying the Media Information panel with disabled local stats

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a44da88b77a1fe47f5e49c11106261d8b50315f8
---

 modules/gui/macosx/playlistinfo.h |    1 +
 modules/gui/macosx/playlistinfo.m |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/playlistinfo.h b/modules/gui/macosx/playlistinfo.h
index b5d59c7..d493641 100644
--- a/modules/gui/macosx/playlistinfo.h
+++ b/modules/gui/macosx/playlistinfo.h
@@ -100,6 +100,7 @@
     input_item_t * p_item;
 
     BOOL b_awakeFromNib;
+    BOOL b_stats;
 }
 @property (readonly) input_item_t * item;
 
diff --git a/modules/gui/macosx/playlistinfo.m b/modules/gui/macosx/playlistinfo.m
index 888351d..60de25a 100644
--- a/modules/gui/macosx/playlistinfo.m
+++ b/modules/gui/macosx/playlistinfo.m
@@ -137,13 +137,14 @@ static VLCInfo *_o_sharedInstance = nil;
 
 - (void)initPanel
 {
-    BOOL b_stats = config_GetInt(VLCIntf, "stats");
+    b_stats = config_GetInt(VLCIntf, "stats");
     if( !b_stats ) {
         if( [o_tab_view numberOfTabViewItems] > 2 )
             [o_tab_view removeTabViewItem: [o_tab_view tabViewItemAtIndex: 2]];
     }
+    else
+        [self initMediaPanelStats];
 
-    [self initMediaPanelStats];
     [o_info_window makeKeyAndOrderFront: self];
 }
 
@@ -270,7 +271,7 @@ static VLCInfo *_o_sharedInstance = nil;
 
 - (void)updateStatistics
 {
-    if (!b_awakeFromNib)
+    if (!b_awakeFromNib || !b_stats)
         return;
 
     if ([o_info_window isVisible]) {



More information about the vlc-commits mailing list