1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-23 21:15:49 +02:00

Clear cache after each update

This commit is contained in:
chylex 2018-11-10 06:20:22 +01:00
parent 1b5304efb7
commit 6f414d312c
2 changed files with 10 additions and 5 deletions

View File

@ -54,6 +54,14 @@ public static void SetClearOnExit(){
RefreshTimer();
}
public static void TryClearNow(){
try{
Directory.Delete(CacheFolder, true);
}catch{
// welp, too bad
}
}
public static void Exit(){
if (AutoClearTimer != null){
AutoClearTimer.Dispose();
@ -61,11 +69,7 @@ public static void Exit(){
}
if (ClearOnExit){
try{
Directory.Delete(CacheFolder, true);
}catch{
// welp, too bad
}
TryClearNow();
}
}
}

View File

@ -126,6 +126,7 @@ private static void Main(){
if (Arguments.HasFlag(Arguments.ArgUpdated)){
WindowsUtils.TryDeleteFolderWhenAble(InstallerPath, 8000);
BrowserCache.TryClearNow();
}
BrowserCache.RefreshTimer();