]> git.sesse.net Git - vlc/commitdiff
macosx: Properly relaunch VLC when asked for.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 16 Sep 2008 07:35:09 +0000 (09:35 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 16 Sep 2008 07:35:09 +0000 (09:35 +0200)
modules/gui/macosx/intf.m

index ba8d2f21b32878da088b68a14de2853e8e801c83..ad0143bc40eff7e7d6ef6cc33a90fb8718d24b17 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/param.h>                                    /* for MAXPATHLEN */
 #include <string.h>
 #include <vlc_keys.h>
+#include <spawn.h>
 
 #ifdef HAVE_CONFIG_H
 #   include "config.h"
@@ -2270,7 +2271,11 @@ end:
     [[NSUserDefaults standardUserDefaults] synchronize];
 
     /* Relaunch now */
-    [[NSWorkspace sharedWorkspace] launchApplication:[[NSBundle mainBundle] bundlePath]];
+    const char * path = [[[NSBundle mainBundle] executablePath] UTF8String];
+    const char *spawnedArgs[2] = { path, NULL };
+    char *spawnedEnv[] = {NULL};
+
+    posix_spawn(NULL, path, NULL, NULL, spawnedArgs, spawnedEnv);
     exit(0);
 }