diff options
author | sr55 <[email protected]> | 2019-02-02 10:56:34 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2019-02-02 10:56:34 +0000 |
commit | 677823cf7c23b52c456c4e8e4a4501688e6398dd (patch) | |
tree | dc984d4d9349a29abcbc87d0b017dd88f4a076cd /win/CS/HandBrakeWPF/Services/PrePostActionService.cs | |
parent | bc05e98fcd4391293231ea31f48805d10d2e3d87 (diff) |
WinGui: Make the disposal of services more aggressive. May Fix or help in #1851
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/PrePostActionService.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/PrePostActionService.cs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/win/CS/HandBrakeWPF/Services/PrePostActionService.cs b/win/CS/HandBrakeWPF/Services/PrePostActionService.cs index b11c814ba..4cbd4c82a 100644 --- a/win/CS/HandBrakeWPF/Services/PrePostActionService.cs +++ b/win/CS/HandBrakeWPF/Services/PrePostActionService.cs @@ -20,9 +20,11 @@ namespace HandBrakeWPF.Services using HandBrake.Interop.Utilities;
using HandBrakeWPF.EventArgs;
+ using HandBrakeWPF.Instance;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Queue.Interfaces;
+ using HandBrakeWPF.Services.Scan.Interfaces;
using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -34,20 +36,10 @@ namespace HandBrakeWPF.Services /// </summary>
public class PrePostActionService : IPrePostActionService
{
- /// <summary>
- /// The queue processor.
- /// </summary>
private readonly IQueueProcessor queueProcessor;
-
- /// <summary>
- /// The user setting service.
- /// </summary>
private readonly IUserSettingService userSettingService;
-
- /// <summary>
- /// The window manager.
- /// </summary>
private readonly IWindowManager windowManager;
+ private readonly IScan scanService;
/// <summary>
/// Initializes a new instance of the <see cref="PrePostActionService"/> class.
@@ -61,11 +53,12 @@ namespace HandBrakeWPF.Services /// <param name="windowManager">
/// The window Manager.
/// </param>
- public PrePostActionService(IQueueProcessor queueProcessor, IUserSettingService userSettingService, IWindowManager windowManager)
+ public PrePostActionService(IQueueProcessor queueProcessor, IUserSettingService userSettingService, IWindowManager windowManager, IScan scanService)
{
this.queueProcessor = queueProcessor;
this.userSettingService = userSettingService;
this.windowManager = windowManager;
+ this.scanService = scanService;
this.queueProcessor.QueueCompleted += QueueProcessorQueueCompleted;
this.queueProcessor.EncodeService.EncodeCompleted += EncodeService_EncodeCompleted;
@@ -157,7 +150,7 @@ namespace HandBrakeWPF.Services });
if (!titleSpecificView.IsCancelled)
- {
+ {
// Do something when the encode ends.
switch (this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction))
{
@@ -166,9 +159,11 @@ namespace HandBrakeWPF.Services ProcessStartInfo shutdown = new ProcessStartInfo("Shutdown", "-s -t 60");
shutdown.UseShellExecute = false;
Process.Start(shutdown);
+ Execute.OnUIThread(() => System.Windows.Application.Current.Shutdown());
break;
case "Log off":
case "Ausloggen":
+ this.scanService.Dispose();
Win32.ExitWindowsEx(0, 0);
break;
case "Suspend":
|