From d06fb83fee27806afb7e78ae6a6dc4e7cf31637a Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 8 May 2016 17:47:28 +0100 Subject: [PATCH] Dispose when restart --- Wox/PublicAPIInstance.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Wox/PublicAPIInstance.cs b/Wox/PublicAPIInstance.cs index 500df1217d..899bff9976 100644 --- a/Wox/PublicAPIInstance.cs +++ b/Wox/PublicAPIInstance.cs @@ -68,6 +68,10 @@ namespace Wox public void RestarApp() { + // we must force dispose application + // UpdateManager.RestartApp() will call Environment.Exit(0) + // which will cause ungraceful exit + ((IDisposable) Application.Current).Dispose(); UpdateManager.RestartApp(); }