diff options
author | sr55 <[email protected]> | 2012-10-07 14:22:34 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-10-07 14:22:34 +0000 |
commit | d5e59956d359b156e086e7ce36a2b6cb358d3c5c (patch) | |
tree | 7ed8392b9e63ae4d167c0a7ca5b75c6065197450 /win/CS/HandBrakeWPF | |
parent | b64dfc0aae97cb64efd89bfb31889cdd762376bd (diff) |
WinGui: Fix an exception when shutting down.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5004 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs index a3506a60d..d68103f78 100644 --- a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs +++ b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs @@ -18,6 +18,7 @@ namespace HandBrakeWPF.Services using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop;
using EncodeCompletedEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs;
using EncodeProgressEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs;
@@ -63,6 +64,11 @@ namespace HandBrakeWPF.Services }
else
{
+ if (ScanServiceWrapper.HandbrakeInstance == null)
+ {
+ ScanServiceWrapper.HandbrakeInstance = new HandBrakeInstance();
+ }
+
this.encodeService = new LibEncode(userSettingService, ScanServiceWrapper.HandbrakeInstance);
}
}
diff --git a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs index ffbbae5c0..9cb6707f9 100644 --- a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs +++ b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs @@ -33,7 +33,7 @@ namespace HandBrakeWPF.Services /// <summary>
/// The handbrake instance.
/// </summary>
- public static readonly IHandBrakeInstance HandbrakeInstance = new HandBrakeInstance();
+ public static IHandBrakeInstance HandbrakeInstance;
/// <summary>
/// The scan service.
@@ -67,6 +67,7 @@ namespace HandBrakeWPF.Services }
else
{
+ HandbrakeInstance = new HandBrakeInstance();
this.scanService = new LibScan(userSettingService, HandbrakeInstance);
}
}
|