Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call jl_atexit_hook when atexit #516

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading