summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-04-18 14:08:09 +0000
committersr55 <[email protected]>2015-04-18 14:08:09 +0000
commitd26d290873503259f71d7c09d3fb3377cc2c9ae8 (patch)
treea752dde3e04f2ad55555e1e5f6c9bf628a649fa8 /win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
parent18ec5828ba1d6fcea88b6109d114efd8dac53206 (diff)
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
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs18
1 files changed, 13 insertions, 5 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)