1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-21 21:54:07 +02:00

Clear cache after each update

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

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

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