devtools: fixed failure to remove devtoolscache when closing the browser

This commit is contained in:
Blu3train 2021-05-26 00:41:19 +02:00
parent 1782292662
commit 1e03e69d00

View File

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