Skip to content

Commit

Permalink
Delete saved avatars on program exit
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Jun 25, 2021
1 parent 9a6727e commit d8362cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,17 @@ private void Form1_Load(object sender, EventArgs e)
/// </summary>
private void Form1_Close(object sender, FormClosingEventArgs e)
{
// Firstly, the notifications and data associated to the program.
if (cleanupOnShutDown)
ToastNotificationManagerCompat.Uninstall();

// Then, all saved avatars.
var files = Directory.GetFiles("images");

foreach (var file in files)
{
File.Delete(file);
}
}

/// <summary>
Expand Down

0 comments on commit d8362cf

Please sign in to comment.