diff options
author | sr55 <[email protected]> | 2017-04-16 10:59:40 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-04-16 10:59:40 +0100 |
commit | 75fbd0a2ca924482c81e65279c76cf9a7506626c (patch) | |
tree | 80f85333fb31ab297843765ce3af9c2d9efd2946 | |
parent | bb92ab00e37bdb87b528b1901d956c1f24417387 (diff) |
WinGui: Fix a possible exception when cancelling and rescanning a source that would cause it to never complete the second time. Fixes #671
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs index 861a5edaf..7114bab64 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs @@ -14,7 +14,6 @@ namespace HandBrake.ApplicationServices.Interop using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
- using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 9bb991efc..0c4637e6f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -2336,8 +2336,12 @@ namespace HandBrakeWPF.ViewModels /// </param>
private void ScanCompleted(object sender, ScanCompletedEventArgs e)
{
- if (e.ScannedSource != null)
+ if (e.ScannedSource != null && !e.Cancelled)
{
+ if (this.ScannedSource == null)
+ {
+ this.ScannedSource = new Source();
+ }
e.ScannedSource.CopyTo(this.ScannedSource);
}
else
|