[vlc-devel] commit: macosx: Properly relaunch VLC when asked for. (Pierre d'Herbemont )

git version control git at videolan.org
Tue Sep 16 09:32:03 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Sep 16 09:35:09 2008 +0200| [03a3319a05f8e8d8ac5bdc2e9fb993c2276aa186] | committer: Pierre d'Herbemont 

macosx: Properly relaunch VLC when asked for.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03a3319a05f8e8d8ac5bdc2e9fb993c2276aa186
---

 modules/gui/macosx/intf.m |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index ba8d2f2..ad0143b 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -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);
 }
 




More information about the vlc-devel mailing list