I have some files written to a temp location in c#. They are then rendered as pdf thumbnails. When the object is destroyed i want the location cleaned up so is it ok in this instance to use a deconstructor?
~Foo()
{
try
{
Directory.Delete(path, true);
}
catch (IOException ex)
{
Console.WriteLine("exception: " + ex.Message + " . from: Foo_Closing");
}