Skip to content

Commit 9c11a89

Browse files
author
Christopher Doris
committed
ensure libpython is closed again
1 parent 6f82c89 commit 9c11a89

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cpython/context.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ function init_context()
178178
if Py_AtExit(@cfunction(_atpyexit, Cvoid, ())) == -1
179179
@warn "Py_AtExit() error"
180180
end
181+
if CTX.which != :embedded
182+
atexit() do
183+
dlclose(CTX.lib_ptr)
184+
end
185+
end
181186
end
182187
end
183188

0 commit comments

Comments
 (0)