mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3535 from Flow-Launcher/temp_file_delete
Fix exception when deleting temp files
This commit is contained in:
commit
d2e63ab437
2 changed files with 14 additions and 3 deletions
|
|
@ -131,7 +131,17 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
File.Delete(tempDbPath);
|
try
|
||||||
|
{
|
||||||
|
if (File.Exists(tempDbPath))
|
||||||
|
{
|
||||||
|
File.Delete(tempDbPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex1)
|
||||||
|
{
|
||||||
|
Main._context.API.LogException(ClassName, $"Failed to delete temporary favicon DB: {tempDbPath}", ex1);
|
||||||
|
}
|
||||||
Main._context.API.LogException(ClassName, $"Failed to copy favicon DB: {dbPath}", ex);
|
Main._context.API.LogException(ClassName, $"Failed to copy favicon DB: {dbPath}", ex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,6 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex
|
||||||
context.CurrentPluginMetadata.PluginCacheDirectoryPath,
|
context.CurrentPluginMetadata.PluginCacheDirectoryPath,
|
||||||
"FaviconCache");
|
"FaviconCache");
|
||||||
|
|
||||||
FilesFolders.ValidateDirectory(_faviconCacheDir);
|
|
||||||
|
|
||||||
LoadBookmarksIfEnabled();
|
LoadBookmarksIfEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,6 +48,9 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate the cache directory before loading all bookmarks because Flow needs this directory to storage favicons
|
||||||
|
FilesFolders.ValidateDirectory(_faviconCacheDir);
|
||||||
|
|
||||||
_cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings);
|
_cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings);
|
||||||
_ = MonitorRefreshQueueAsync();
|
_ = MonitorRefreshQueueAsync();
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue