]> git.sesse.net Git - vlc/commitdiff
Avoid a call to unsetenv/putenv on Qt4.6
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 12 Apr 2010 20:16:01 +0000 (23:16 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 12 Apr 2010 20:16:01 +0000 (23:16 +0300)
This trick does not work with Qt <= 4.5 unfortunately.

bin/vlc.c

index 9e769b018cb80fc42eeac674d146dcbc78271658..e141b4b431728c065c0c0d9facb00ae3dc3150d6 100644 (file)
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -75,6 +75,12 @@ int main( int i_argc, const char *ppsz_argv[] )
      * use the alpha channel for the embedded video window. */
     putenv( (char *)"XLIB_SKIP_ARGB_VISUALS=1" );
 #endif
+#ifdef HAVE_SETENV
+    /* Clear the X.Org startup notification ID. Otherwise the UI might try to
+     * change the environment while the process is multi-threaded. That could
+     * crash. Screw you X.Org. Next time write a thread-safe specification. */
+    unsetenv ("DESKTOP_STARTUP_ID");
+#endif
 
 #ifndef ALLOW_RUN_AS_ROOT
     if (geteuid () == 0)