Skip to content

Commit

Permalink
macosx: fix crash when displaying the Media Information panel with di…
Browse files Browse the repository at this point in the history
…sabled local stats
  • Loading branch information
fkuehne committed Nov 14, 2012
1 parent 0397c9b commit a44da88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/gui/macosx/playlistinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
input_item_t * p_item;

BOOL b_awakeFromNib;
BOOL b_stats;
}
@property (readonly) input_item_t * item;

Expand Down
7 changes: 4 additions & 3 deletions modules/gui/macosx/playlistinfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,14 @@ - (void)dealloc

- (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];
}

Expand Down Expand Up @@ -270,7 +271,7 @@ - (void)setMeta: (char *)psz_meta forLabel: (id)theItem

- (void)updateStatistics
{
if (!b_awakeFromNib)
if (!b_awakeFromNib || !b_stats)
return;

if ([o_info_window isVisible]) {
Expand Down

0 comments on commit a44da88

Please sign in to comment.