mirror of
https://github.com/greenshot/greenshot
synced 2025-07-14 17:13:44 -07:00
Added tmp-file cleanup, including the cached entry, currently only for Excel.
This commit is contained in:
parent
1c0dc61bd8
commit
fa79ebb727
2 changed files with 21 additions and 2 deletions
|
@ -541,6 +541,25 @@ namespace GreenshotPlugin.Core {
|
|||
return tmpFile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a tmpfile which was created by SaveNamedTmpFile
|
||||
/// Used e.g. by the email export
|
||||
/// </summary>
|
||||
/// <param name="tmpfile"></param>
|
||||
/// <returns>true if it worked</returns>
|
||||
public static bool DeleteNamedTmpFile(string tmpfile) {
|
||||
LOG.Debug("Deleting TMP File: " + tmpfile);
|
||||
try {
|
||||
if (File.Exists(tmpfile)) {
|
||||
File.Delete(tmpfile);
|
||||
tmpFileCache.Remove(tmpfile);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a temp image file
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue