From e81ba5243ac44ea175500e447c1808beddc6eb09 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Mon, 21 Dec 2020 13:38:53 +0100 Subject: [PATCH] Launch the web browser in a clean environment to be able to launch firefox from universal binaries --- src/LightApp/LightApp_Application.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 1aa01cf53..efa47c001 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1206,12 +1206,16 @@ protected: { if ( !myBrowser.isEmpty() && !myUrl.isEmpty() ) { + QProcess* proc = new QProcess(); #ifdef WIN32 QString cmdLine = QString( "\"%1\" %2 \"%3\"" ).arg( myBrowser, myParameters, myUrl ); #else QString cmdLine = QString( "%1 %2 \"%3\"" ).arg( myBrowser, myParameters, myUrl ); + // unset LD_LIBRARY_PATH to launch the web browser in a clean environment + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + env.insert("LD_LIBRARY_PATH", ""); + proc->setProcessEnvironment(env); #endif - QProcess* proc = new QProcess(); proc->start( cmdLine ); if ( !proc->waitForStarted() ) { -- 2.39.2