]> git.sesse.net Git - vlc/commitdiff
Mac OS X gui: Make sure the "force quit" menu item is handled instantly.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 19 Mar 2007 22:56:04 +0000 (22:56 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 19 Mar 2007 22:56:04 +0000 (22:56 +0000)
modules/gui/macosx/intf.m

index 58bd0a811d1a96c4bf470fa7ba3e02acef94e498..4555b941f2a0fac75813bfd3fd70310c077b5e1e 100644 (file)
@@ -110,10 +110,21 @@ jmp_buf jmpbuffer;
 
 static void Run( intf_thread_t *p_intf )
 {
+    sigset_t set;
+
     /* Do it again - for some unknown reason, vlc_thread_create() often
      * fails to go to real-time priority with the first launched thread
      * (???) --Meuuh */
     vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );
+
+    /* Make sure the "force quit" menu item does quit instantly.
+     * VLC overrides SIGTERM which is sent by the "force quit"
+     * menu item to make sure deamon mode quits gracefully, so
+     * we un-override SIGTERM here. */
+    sigemptyset( &set );
+    sigaddset( &set, SIGTERM );
+    pthread_sigmask( SIG_UNBLOCK, &set, NULL );
+
     [[VLCMain sharedInstance] setIntf: p_intf];
     [NSBundle loadNibNamed: @"MainMenu" owner: NSApp];