Skip to content

Commit 0614809

Browse files
dpinolDani Pinyol
and
Dani Pinyol
authored
call jl_atexit_hook when atexit (#516)
Co-authored-by: Dani Pinyol <[email protected]>
1 parent 6437514 commit 0614809

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pysrc/juliacall/__init__.py

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
__version__ = '0.9.20'
55

6+
import atexit
7+
68
_newmodule = None
79

810
def newmodule(name):
@@ -199,6 +201,13 @@ def args_from_config():
199201
None if sysimg is None else sysimg.encode('utf8'),
200202
)
201203

204+
@atexit.register
205+
def at_jl_exit():
206+
jl_atexit_hook = lib.jl_atexit_hook
207+
jl_atexit_hook.argtypes = [c.c_int]
208+
jl_atexit_hook.restype = None
209+
jl_atexit_hook(0)
210+
202211
# initialise PythonCall
203212
jl_eval = lib.jl_eval_string
204213
jl_eval.argtypes = [c.c_char_p]

0 commit comments

Comments
 (0)