From 5f44f5001f8019a79e41b0bb0f2385bf8c2c333f Mon Sep 17 00:00:00 2001 From: HowieHz <94725606+HowieHz@users.noreply.github.com> Date: Sat, 18 Jun 2022 19:48:20 +0800 Subject: [PATCH] 1.6.2-a.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用jpype的模块无法正常退出虚拟机,导致程序进程残留 --- src/Plugin/A_Plus_B_import_Java_schz/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Plugin/A_Plus_B_import_Java_schz/__init__.py b/src/Plugin/A_Plus_B_import_Java_schz/__init__.py index 846b1c8..f1ddedf 100644 --- a/src/Plugin/A_Plus_B_import_Java_schz/__init__.py +++ b/src/Plugin/A_Plus_B_import_Java_schz/__init__.py @@ -3,6 +3,7 @@ import hpyculator as hpyc import jpype +import atexit NAME = "高精度浮点数加法(基于Java)" VERSION = "V1.0.3" @@ -79,3 +80,4 @@ def on_calculate(data, todo): else: hpyc.write(jpype.JClass("com.shacha.Main").main(a, b)) # jpype.shutdownJVM() Shutdown must be called from main thread + atexit.register(jpype.shutdownJVM) # 退出执行函数,否则虚拟机不会退出,导致退出残留