From 05904e3770a00364cafaa364852dc4524c6adca8 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Wed, 23 Nov 2022 08:42:26 +0800 Subject: [PATCH] FIX: [STUDIO-1419] conflict when removing old logs by multi process Change-Id: I6529fa649020a2d4419048e470e343bfd63c41bf --- src/slic3r/GUI/GUI_App.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index f29f6656c..b1a7ae7c9 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1159,8 +1159,11 @@ void GUI_App::post_init() std::vector> files_vec; for (auto& it : boost::filesystem::directory_iterator(log_folder)) { auto temp_path = it.path(); - std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ; - files_vec.push_back({ lw_t, temp_path.filename().string() }); + try { + std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ; + files_vec.push_back({ lw_t, temp_path.filename().string() }); + } catch (const std::exception &ex) { + } } std::sort(files_vec.begin(), files_vec.end(), []( std::pair &a, std::pair &b) {