From 1e03e69d00c6d9dc09b5acb2191cc1e8d7cf5230 Mon Sep 17 00:00:00 2001 From: Blu3train Date: Wed, 26 May 2021 00:41:19 +0200 Subject: [PATCH] devtools: fixed failure to remove devtoolscache when closing the browser --- extensions/devtools.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/devtools.cpp b/extensions/devtools.cpp index 156f99c..e73865a 100644 --- a/extensions/devtools.cpp +++ b/extensions/devtools.cpp @@ -87,7 +87,10 @@ namespace DevTools CloseHandle(processInfo.hProcess); 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"); }