Commit 0d847ccb authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix subtile bug in initialization of mainwindow

Currently, two objects of the class VLCMainWindow are generated. The first is alloated
from intf.m (triggered by the first log message that arrives) and is initialized by
both init and initWithContentRect. The second object is created from inside the nib file,
and is instantiated ONLY with initWithContentRect. Therefore, up to now _o_sharedInstance
had the wrong object and all calls to sharedInstance would cause problems.
But somehow, o_mainwindow in intf.m is updated to the correct second object, although it holds
the first object at start.

Furthermore, o_fspanel is also instantiated through the nib file.
parent 6a49e292
......@@ -56,14 +56,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (id)init
{
if( _o_sharedInstance)
if( _o_sharedInstance )
{
[self dealloc];
return _o_sharedInstance;
}
else
{
o_fspanel = [[VLCFSPanel alloc] init];
_o_sharedInstance = [super init];
}
......@@ -89,6 +88,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
self = [super initWithContentRect:contentRect styleMask:styleMask
backing:backingType defer:flag];
_o_sharedInstance = self;
[[VLCMain sharedInstance] updateTogglePlaylistState];
......
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