From a8c6a975799aa846585f1a6c1b09fbbc615ab8d5 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 29 Nov 2015 05:14:56 +0000 Subject: [PATCH] Better mutex cleanup --- Wox/Helper/SingleInstance.cs | 6 +----- Wox/MainWindow.xaml.cs | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Wox/Helper/SingleInstance.cs b/Wox/Helper/SingleInstance.cs index 20a51fefa5..c62fefc0ad 100644 --- a/Wox/Helper/SingleInstance.cs +++ b/Wox/Helper/SingleInstance.cs @@ -302,11 +302,7 @@ namespace Wox.Helper /// public static void Cleanup() { - if (singleInstanceMutex != null) - { - singleInstanceMutex.Close(); - singleInstanceMutex = null; - } + singleInstanceMutex?.ReleaseMutex(); if (channel != null) { diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 7f2aaf60a4..eda169be96 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -80,7 +80,6 @@ namespace Wox public void CloseApp() { - SingleInstance.singleInstanceMutex.ReleaseMutex(); Application.Current.Shutdown(); }