From 31803fd961dd505b04fb8ecb21812ede80acceb2 Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
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 a36d084ea..c5b6fe251 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;
 			}
-- 
GitLab