Use `setenv`instead as `putenv` makes Lutris' wine crash for some reason (threading?)

pull/316/head v0.5.1
jackun 4 years ago
parent 4f64e1403a
commit e56b7ded15
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -727,18 +727,13 @@ void init_system_info(){
char *dir = dirname((char*)wineProcess.c_str());
stringstream findVersion;
findVersion << "\"" << dir << "/wine\" --version";
bool env_exists = false;
if (getenv("WINELOADERNOEXEC")) {
static char removenoexec[] = "WINELOADERNOEXEC";
putenv(removenoexec);
env_exists = true;
}
const char *wine_env = getenv("WINELOADERNOEXEC");
if (wine_env)
unsetenv("WINELOADERNOEXEC");
wineVersion = exec(findVersion.str());
std::cout << "WINE VERSION = " << wineVersion << "\n";
if (env_exists) {
static char noexec[] = "WINELOADERNOEXEC=1";
putenv(noexec);
}
if (wine_env)
setenv("WINELOADERNOEXEC", wine_env, 1);
}
}
else {

Loading…
Cancel
Save