From d26d290873503259f71d7c09d3fb3377cc2c9ae8 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 18 Apr 2015 14:08:09 +0000 Subject: [PATCH] WinGui: Misc UI fixes and fixes to the logging code for scanning that could sometimes cause a crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7094 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Services/Scan/LibScan.cs | 18 ++- .../Controls/SourceSelection.xaml | 6 +- win/CS/HandBrakeWPF/Controls/StatusPanel.xaml | 68 ++++++++--- .../HandBrakeWPF/Controls/StatusPanel.xaml.cs | 78 ++++++++++++- .../HandBrakeWPF/ViewModels/MainViewModel.cs | 12 ++ win/CS/HandBrakeWPF/Views/AboutView.xaml | 4 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 22 ++-- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 106 ++++++++---------- win/CS/HandBrakeWPF/Views/ShellView.xaml | 4 +- 9 files changed, 218 insertions(+), 100 deletions(-) diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index a560493ab..6e16fa937 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -168,8 +168,12 @@ namespace HandBrake.ApplicationServices.Services.Scan { try { - this.scanLog.Close(); - this.scanLog.Dispose(); + lock (LogLock) + { + this.scanLog.Close(); + this.scanLog.Dispose(); + this.scanLog = null; + } this.instance.Dispose(); } catch (Exception) @@ -227,10 +231,14 @@ namespace HandBrake.ApplicationServices.Services.Scan this.IsScanning = false; this.instance.StopScan(); - if (this.scanLog != null) + lock (LogLock) { - this.scanLog.Close(); - this.scanLog.Dispose(); + if (this.scanLog != null) + { + this.scanLog.Close(); + this.scanLog.Dispose(); + this.scanLog = null; + } } } catch (Exception) diff --git a/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml b/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml index dd7650b31..44d600c4e 100644 --- a/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml +++ b/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml @@ -15,11 +15,11 @@ - + - + @@ -86,7 +86,7 @@ - +