Skip to content

Reset GIL thread static data when disposing an environment#385

Draft
gabrielgt wants to merge 2 commits intotonybaloney:mainfrom
gabrielgt:fix/dispose-environment
Draft

Reset GIL thread static data when disposing an environment#385
gabrielgt wants to merge 2 commits intotonybaloney:mainfrom
gabrielgt:fix/dispose-environment

Conversation

@gabrielgt
Copy link
Copy Markdown
Contributor

To allow using multiple Python environments sequentially, it is necessary to completely reset the internal data of the GIL class when an environment is disposed and the Python interpreter is finalized. Otherwise, an exception will be raised when trying to access a thread state that no longer exists.

This fix doesn't fully resolve the issue #296, but it at least allows sequential execution of multiple different environments.

@gabrielgt gabrielgt marked this pull request as draft March 31, 2025 16:43
@gabrielgt gabrielgt force-pushed the fix/dispose-environment branch from c3d4bfc to dfda486 Compare May 9, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant