Commit 06ecc0b0 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* - This should fix the "crash upon quit" issue with VLC Mac OS X.

  - It should also no longer crash if you select macosx as an extraintf. This is not allowed. It is the cause of the NSDictionary crash reported often in the forums. Notice however that if you have selected a primary interface that is not macosx, you might end up with a "blank application" forcing you to reset the preferences manually (your fault for mocking with them in the first place).
  - Should fix clivlc mode. (this mode allows you to run VLC on OSX while no user is logged in, in the GUI).

Thanks to Jean-Michel Vallat for kicking my ass. :D
parent d91bba21
......@@ -806,7 +806,6 @@ static VLCMain *_o_sharedMainInstance = nil;
- (void)manage
{
NSDate * o_sleep_date;
playlist_t * p_playlist;
/* new thread requires a new pool */
......@@ -861,12 +860,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[self manageVolumeSlider];
vlc_mutex_unlock( &p_intf->change_lock );
o_sleep_date = [NSDate dateWithTimeIntervalSinceNow: .1];
[NSThread sleepUntilDate: o_sleep_date];
msleep( 100000 );
}
[self terminate];
[o_pool release];
}
......@@ -1434,7 +1429,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[[NSUserDefaults standardUserDefaults] synchronize];
p_intf->b_die = VLC_TRUE;
[NSApp stop:NULL];
}
- (IBAction)clearRecentItems:(id)sender
......
......@@ -66,8 +66,11 @@ static int AddIntfCallback( vlc_object_t *, char const *,
*****************************************************************************/
@interface VLCApplication : NSApplication
{
vlc_t *o_vlc;
}
- (void)setVLC: (vlc_t *)p_vlc;
@end
#endif
......@@ -157,11 +160,12 @@ int intf_RunThread( intf_thread_t *p_intf )
}
}
if( p_intf->b_block && strncmp( p_intf->p_module->psz_object_name,
if( p_intf->b_block && strncmp( p_intf->p_vlc->psz_object_name,
"clivlc", 6) )
{
o_pool = [[NSAutoreleasePool alloc] init];
[VLCApplication sharedApplication];
[NSApp setVLC: p_intf->p_vlc];
}
if( p_intf->b_block &&
......@@ -175,6 +179,11 @@ int intf_RunThread( intf_thread_t *p_intf )
else
{
/* Run the interface in a separate thread */
if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) )
{
msg_Err( p_intf, "You cannot run the MacOS X module as an extrainterface. Please read the README.MacOSX.rtf file");
return VLC_EGENERIC;
}
if( vlc_thread_create( p_intf, "interface", RunInterface,
VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) )
{
......@@ -446,6 +455,11 @@ static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd,
*****************************************************************************/
@implementation VLCApplication
- (void)setVLC: (vlc_t *) p_vlc
{
o_vlc = p_vlc;
}
- (void)stop: (id)sender
{
NSEvent *o_event;
......@@ -465,9 +479,7 @@ static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd,
- (void)terminate: (id)sender
{
if( [NSApp isRunning] )
[NSApp stop:sender];
[super terminate: sender];
o_vlc->b_die = VLC_TRUE;
}
@end
......
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