Merge pull request #578 from Blu3train/devtools_fixed_failure_remove_devtoolscache

devtools: fixed failure to remove devtoolscache when closing the program
This commit is contained in:
Akash Mozumdar 2021-06-05 08:31:46 -06:00 committed by GitHub
commit de3cad37f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,6 +149,12 @@ namespace DevTools
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
}
for (int retry = 0; ++retry < 20; Sleep(100))
{
try { std::filesystem::remove_all(L"devtoolscache"); break; }
catch (std::filesystem::filesystem_error) { continue; }
}
OnStatusChanged("Stopped");
try { std::filesystem::remove_all(L"devtoolscache"); } catch (std::filesystem::filesystem_error) {}
StatusChanged("Stopped");
}