Skip to content

Commit

Permalink
Run Python garbage collector when an interpreter is closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsteffensmeier committed Sep 16, 2024
1 parent 79b6fd2 commit 388b176
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/c/Jep/pyembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ void pyembed_thread_close(JNIEnv *env, intptr_t _jepThread)
Py_DECREF(key);

Py_CLEAR(jepThread->globals);
PyGC_Collect();

if (jepThread->classloader) {
(*env)->DeleteGlobalRef(env, jepThread->classloader);
Expand Down

0 comments on commit 388b176

Please sign in to comment.