From a38ac41abe1a2c844566afcda52eefe5dde83a82 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 12 Jun 2022 18:51:52 +0800 Subject: [PATCH] =?UTF-8?q?fix.=E4=BF=AE=E5=A4=8Dc#=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E9=87=8A=E6=94=BEasst=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/855 --- src/MeoAsstGui/Helper/AsstProxy.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MeoAsstGui/Helper/AsstProxy.cs index e3d3fb4cef..5b6b95eba6 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MeoAsstGui/Helper/AsstProxy.cs @@ -74,6 +74,14 @@ namespace MeoAsstGui _callback = CallbackFunction; } + ~AsstProxy() + { + if (_handle != IntPtr.Zero) + { + AsstDestroy(); + } + } + public void Init() { bool loaded = AsstLoadResource(System.IO.Directory.GetCurrentDirectory()); @@ -809,6 +817,11 @@ namespace MeoAsstGui { return AsstStop(_handle); } + + public void AsstDestroy() + { + AsstDestroy(_handle); + } } public enum AsstMsg