fix unchecked optionals

also discard exceptions in file cache futures
This commit is contained in:
ouwou
2021-10-08 17:52:38 -04:00
parent abc0a7931e
commit fa1a007dc1
7 changed files with 40 additions and 23 deletions

View File

@@ -17,8 +17,13 @@ Cache::Cache() {
Cache::~Cache() {
m_worker.stop();
for (auto &future : m_futures)
if (future.valid()) future.get();
for (auto &future : m_futures) {
if (future.valid()) {
try { // dont care about stored exceptions
future.get();
} catch (...) {}
}
}
std::error_code err;
if (!std::filesystem::remove_all(m_tmp_path, err))