From 8575fb9c87ca348f9a37c6271515fa1309ad1726 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 19 Oct 2012 07:35:37 -0700 Subject: [PATCH] Don't use wxRemoveFile in the cache cleaner wxRemoveFile notifies the user of errors via a dialog box, and errors when cleaning the cache are normally just due to two copies of Aegisub trying to clean it at the same time. --- aegisub/src/utils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aegisub/src/utils.cpp b/aegisub/src/utils.cpp index 8a64227b8..466c6ee87 100644 --- a/aegisub/src/utils.cpp +++ b/aegisub/src/utils.cpp @@ -378,7 +378,12 @@ class cache_cleaner : public wxThread { break; int64_t fsize = i->second.GetSize().GetValue(); - if (!wxRemoveFile(i->second.GetFullPath())) { +#ifdef __WXMSW__ + int res = wxRemove(i->second.GetFullPath()); +#else + int res = unlink(i->second.GetFullPath().fn_str()); +#endif + if (res) { LOG_D("utils/clean_cache") << "failed to remove file " << STD_STR(i->second.GetFullPath()); continue; }