mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-04 13:04:21 +00:00
For sanity only restore hooking env vars if we have something to restore
* If things went drastically wrong, better to leave these alone than set to empty.
This commit is contained in:
1 file changed
+13
-4
@@ -916,10 +916,19 @@ void GetHookedEnvp(char *const *envp, rdcstr &envpStr, rdcarray<char *> &modifie
|
||||
|
||||
void ResetHookingEnvVars()
|
||||
{
|
||||
direct_setenv(LIB_PATH_ENV_VAR, Process::GetEnvVariable("RENDERDOC_ORIGLIBPATH").c_str(), true);
|
||||
direct_setenv(PRELOAD_ENV_VAR, Process::GetEnvVariable("RENDERDOC_ORIGPRELOAD").c_str(), true);
|
||||
direct_setenv("RENDERDOC_ORIGLIBPATH", "", true);
|
||||
direct_setenv("RENDERDOC_ORIGPRELOAD", "", true);
|
||||
rdcstr origpath = Process::GetEnvVariable("RENDERDOC_ORIGLIBPATH");
|
||||
rdcstr origpreload = Process::GetEnvVariable("RENDERDOC_ORIGPRELOAD");
|
||||
|
||||
if(!origpath.empty())
|
||||
{
|
||||
direct_setenv(LIB_PATH_ENV_VAR, origpath.c_str(), true);
|
||||
direct_setenv("RENDERDOC_ORIGLIBPATH", "", true);
|
||||
}
|
||||
if(!origpreload.empty())
|
||||
{
|
||||
direct_setenv(PRELOAD_ENV_VAR, origpreload.c_str(), true);
|
||||
direct_setenv("RENDERDOC_ORIGPRELOAD", "", true);
|
||||
}
|
||||
}
|
||||
|
||||
rdcpair<RDResult, uint32_t> Process::LaunchAndInjectIntoProcess(
|
||||
|
||||
Reference in new issue
Block a user