Commit 25f5b205 authored by David Fuhrmann's avatar David Fuhrmann

macosx: remove o_appLock, rename f_appExit

Lock is not needed anymore, as this variable is only accessed
from the main thread.
parent d7e5748f
......@@ -98,6 +98,8 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
IBOutlet VLCControls * o_controls; /* VLCControls */
IBOutlet VLCPlaylist * o_playlist; /* VLCPlaylist */
bool b_intf_terminating; /* Makes sure applicationWillTerminate will be called only once */
AppleRemote * o_remote;
BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
......
......@@ -102,7 +102,6 @@ static int BossCallback(vlc_object_t *, const char *,
static atomic_bool b_intf_starting = ATOMIC_VAR_INIT(false);
static NSLock * o_appLock = nil; // controls access to f_appExit
static NSLock * o_vout_provider_lock = nil;
......@@ -119,7 +118,6 @@ int OpenIntf (vlc_object_t *p_this)
[VLCApplication sharedApplication];
o_appLock = [[NSLock alloc] init];
o_vout_provider_lock = [[NSLock alloc] init];
[[VLCMain sharedInstance] setIntf: p_intf];
......@@ -141,7 +139,6 @@ void CloseIntf (vlc_object_t *p_this)
msg_Dbg(p_this, "Closing macosx interface");
[[VLCMain sharedInstance] applicationWillTerminate:nil];
[o_appLock release];
[o_vout_provider_lock release];
o_vout_provider_lock = nil;
[o_pool release];
......@@ -812,29 +809,19 @@ static VLCMain *_o_sharedMainInstance = nil;
PL_UNLOCK;
}
/* don't allow a double termination call. If the user has
* already invoked the quit then simply return this time. */
static bool f_appExit = false;
#pragma mark -
#pragma mark Termination
- (BOOL)isTerminating
{
return f_appExit;
return b_intf_terminating;
}
- (void)applicationWillTerminate:(NSNotification *)notification
{
bool isTerminating;
[o_appLock lock];
isTerminating = f_appExit;
f_appExit = true;
[o_appLock unlock];
if (isTerminating)
if (b_intf_terminating)
return;
b_intf_terminating = true;
[self resumeItunesPlayback:nil];
......
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