Skip to content

Commit 5f44f50

Browse files
committed
1.6.2-a.3
使用jpype的模块无法正常退出虚拟机,导致程序进程残留
1 parent f920325 commit 5f44f50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Plugin/A_Plus_B_import_Java_schz/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import hpyculator as hpyc
55
import jpype
6+
import atexit
67

78
NAME = "高精度浮点数加法(基于Java)"
89
VERSION = "V1.0.3"
@@ -79,3 +80,4 @@ def on_calculate(data, todo):
7980
else:
8081
hpyc.write(jpype.JClass("com.shacha.Main").main(a, b))
8182
# jpype.shutdownJVM() Shutdown must be called from main thread
83+
atexit.register(jpype.shutdownJVM) # 退出执行函数,否则虚拟机不会退出,导致退出残留

0 commit comments

Comments
 (0)