Skip to content

Commit

Permalink
call jl_atexit_hook when atexit (#516)
Browse files Browse the repository at this point in the history
Co-authored-by: Dani Pinyol <[email protected]>
  • Loading branch information
dpinol and Dani Pinyol authored Jul 7, 2024
1 parent 6437514 commit 0614809
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pysrc/juliacall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

__version__ = '0.9.20'

import atexit

_newmodule = None

def newmodule(name):
Expand Down Expand Up @@ -199,6 +201,13 @@ def args_from_config():
None if sysimg is None else sysimg.encode('utf8'),
)

@atexit.register
def at_jl_exit():
jl_atexit_hook = lib.jl_atexit_hook
jl_atexit_hook.argtypes = [c.c_int]
jl_atexit_hook.restype = None
jl_atexit_hook(0)

# initialise PythonCall
jl_eval = lib.jl_eval_string
jl_eval.argtypes = [c.c_char_p]
Expand Down

0 comments on commit 0614809

Please sign in to comment.