From 6a9c4f61accba598f4e3fb2d4687f3b3c9cf9b3e Mon Sep 17 00:00:00 2001 From: Julien Caillon Date: Sun, 21 Oct 2018 16:04:48 +0200 Subject: [PATCH] Clean up after extraction cancellation --- CabinetManager/core/CfCabinet.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CabinetManager/core/CfCabinet.cs b/CabinetManager/core/CfCabinet.cs index 4f62b89..6af1157 100644 --- a/CabinetManager/core/CfCabinet.cs +++ b/CabinetManager/core/CfCabinet.cs @@ -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);