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; ...@@ -806,7 +806,6 @@ static VLCMain *_o_sharedMainInstance = nil;
- (void)manage - (void)manage
{ {
NSDate * o_sleep_date;
playlist_t * p_playlist; playlist_t * p_playlist;
/* new thread requires a new pool */ /* new thread requires a new pool */
...@@ -861,12 +860,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -861,12 +860,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[self manageVolumeSlider]; [self manageVolumeSlider];
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
msleep( 100000 );
o_sleep_date = [NSDate dateWithTimeIntervalSinceNow: .1];
[NSThread sleepUntilDate: o_sleep_date];
} }
[self terminate];
[o_pool release]; [o_pool release];
} }
...@@ -1434,7 +1429,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1434,7 +1429,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
p_intf->b_die = VLC_TRUE; p_intf->b_die = VLC_TRUE;
[NSApp stop:NULL];
} }
- (IBAction)clearRecentItems:(id)sender - (IBAction)clearRecentItems:(id)sender
......
...@@ -66,8 +66,11 @@ static int AddIntfCallback( vlc_object_t *, char const *, ...@@ -66,8 +66,11 @@ static int AddIntfCallback( vlc_object_t *, char const *,
*****************************************************************************/ *****************************************************************************/
@interface VLCApplication : NSApplication @interface VLCApplication : NSApplication
{ {
vlc_t *o_vlc;
} }
- (void)setVLC: (vlc_t *)p_vlc;
@end @end
#endif #endif
...@@ -157,11 +160,12 @@ int intf_RunThread( intf_thread_t *p_intf ) ...@@ -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) ) "clivlc", 6) )
{ {
o_pool = [[NSAutoreleasePool alloc] init]; o_pool = [[NSAutoreleasePool alloc] init];
[VLCApplication sharedApplication]; [VLCApplication sharedApplication];
[NSApp setVLC: p_intf->p_vlc];
} }
if( p_intf->b_block && if( p_intf->b_block &&
...@@ -175,6 +179,11 @@ int intf_RunThread( intf_thread_t *p_intf ) ...@@ -175,6 +179,11 @@ int intf_RunThread( intf_thread_t *p_intf )
else else
{ {
/* Run the interface in a separate thread */ /* 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, if( vlc_thread_create( p_intf, "interface", RunInterface,
VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) )
{ {
...@@ -446,6 +455,11 @@ static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -446,6 +455,11 @@ static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd,
*****************************************************************************/ *****************************************************************************/
@implementation VLCApplication @implementation VLCApplication
- (void)setVLC: (vlc_t *) p_vlc
{
o_vlc = p_vlc;
}
- (void)stop: (id)sender - (void)stop: (id)sender
{ {
NSEvent *o_event; NSEvent *o_event;
...@@ -465,9 +479,7 @@ static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -465,9 +479,7 @@ static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd,
- (void)terminate: (id)sender - (void)terminate: (id)sender
{ {
if( [NSApp isRunning] ) o_vlc->b_die = VLC_TRUE;
[NSApp stop:sender];
[super terminate: sender];
} }
@end @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