diff options
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs | 7 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs | 16 |
2 files changed, 10 insertions, 13 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index 0ed17fb51..942644f2e 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -62,8 +62,6 @@ namespace HandBrake.ApplicationServices.Services.Encode /// </summary>
public LibEncode()
{
- HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
- HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
}
/// <summary>
@@ -96,6 +94,8 @@ namespace HandBrake.ApplicationServices.Services.Encode // Create a new HandBrake instance
// Setup the HandBrake Instance
+ HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
this.instance = HandBrakeInstanceManager.GetEncodeInstance(job.Configuration.Verbosity);
this.instance.EncodeCompleted += this.InstanceEncodeCompleted;
this.instance.EncodeProgress += this.InstanceEncodeProgress;
@@ -348,6 +348,9 @@ namespace HandBrake.ApplicationServices.Services.Encode ? new EventArgs.EncodeCompletedEventArgs(false, null, string.Empty, this.currentTask.Task.Destination)
: new EventArgs.EncodeCompletedEventArgs(true, null, string.Empty, this.currentTask.Task.Destination));
+ HandBrakeUtils.MessageLogged -= this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged -= this.HandBrakeInstanceErrorLogged;
+
this.ShutdownFileWriter();
}
#endregion
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index 796ef5db5..721959a90 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -101,18 +101,7 @@ namespace HandBrake.ApplicationServices.Services.Scan public LibScan()
{
this.logging = new StringBuilder();
-
this.header = GeneralUtilities.CreateCliLogHeader();
-
- try
- {
- HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
- HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
- }
- catch (Exception)
- {
- // Do nothing.
- }
}
#region Events
@@ -226,6 +215,8 @@ namespace HandBrake.ApplicationServices.Services.Scan this.scanLog = new StreamWriter(this.dvdInfoPath);
// Create a new HandBrake Instance.
+ HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
this.instance = HandBrakeInstanceManager.GetScanInstance(configuraiton.Verbosity);
this.instance.ScanProgress += this.InstanceScanProgress;
this.instance.ScanCompleted += this.InstanceScanCompleted;
@@ -374,6 +365,9 @@ namespace HandBrake.ApplicationServices.Services.Scan // Do Nothing.
}
+ HandBrakeUtils.MessageLogged -= this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged -= this.HandBrakeInstanceErrorLogged;
+
// TODO -> Might be a better place to fix this.
string path = this.currentSourceScanPath;
if (this.currentSourceScanPath.Contains("\""))
|