Changeset 2781


Ignore:
Timestamp:
07/16/12 11:19:40 (2 years ago)
Author:
lowjoel
Message:

Modification from r2779 of Eraser 6.0: When an exception is thrown when locking a volume, do not execute the cleanup code since it cannot run. At the same time, make the Dispose method idempotent, as required by IDisposable.

Fixes https://eraser.heidi.ie/forum/viewtopic.php?f=2&t=8866.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser

  • trunk/eraser/Eraser.Util/VolumeInfo.cs

    r2660 r2781  
    826826        protected override void Dispose(bool disposing) 
    827827        { 
    828             if (Access == FileAccess.Write || Access == FileAccess.ReadWrite) 
     828            if ((Access == FileAccess.Write || Access == FileAccess.ReadWrite) && IsLocked) 
    829829                UnlockVolume(); 
    830830            base.Dispose(disposing); 
Note: See TracChangeset for help on using the changeset viewer.