diff options
author | Scott <[email protected]> | 2020-04-29 19:06:11 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-29 19:06:11 +0100 |
commit | 91051b41df7f9e6da68d14c9e806968df61ef050 (patch) | |
tree | 90293ad067e14e9eff409ed7bf5d105df3697a45 /win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs | |
parent | 565dae9f71330b87c5e7898a469052446c4592f0 (diff) |
WinGui: Enable multi-instance support. (#2797)
Diffstat (limited to 'win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs b/win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs index a343a1afd..51ac11458 100644 --- a/win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs +++ b/win/CS/HandBrakeWPF/Instance/HandBrakeInstanceManager.cs @@ -44,12 +44,6 @@ namespace HandBrakeWPF.Instance throw new Exception("Please call Init before Using!"); } - if (encodeInstance != null) - { - encodeInstance.Dispose(); - encodeInstance = null; - } - IEncodeInstance newInstance; if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ProcessIsolationEnabled) && Portable.IsProcessIsolationEnabled()) @@ -58,16 +52,19 @@ namespace HandBrakeWPF.Instance } else { + if (encodeInstance != null && !encodeInstance.IsRemoteInstance) + { + encodeInstance.Dispose(); + encodeInstance = null; + } + newInstance = new HandBrakeInstance(); + HandBrakeUtils.SetDvdNav(!userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav)); + encodeInstance = newInstance; } newInstance.Initialize(verbosity, noHardware); - - encodeInstance = newInstance; - - HandBrakeUtils.SetDvdNav(!userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav)); - - return encodeInstance; + return newInstance; } /// <summary> |