Skip to content

Commit

Permalink
Clean up after extraction cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaillon committed Oct 21, 2018
1 parent b1ee43c commit 6a9c4f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CabinetManager/core/CfCabinet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,11 @@ void Progress(CfSaveEventArgs args) {

try {
fileToExtract.Parent.ExtractFileFromDataBlocks(_reader, relativePathInCab, extractionPath, _cancelToken, Progress);
} finally {
} catch(OperationCanceledException) {
if (File.Exists(extractionPath)) {
File.Delete(extractionPath);
}
throw;
}

File.SetCreationTime(extractionPath, fileToExtract.FileDateTime);
Expand Down

0 comments on commit 6a9c4f6

Please sign in to comment.