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

fix(neon): Do not panic when dropping a Root if the VM has shutdown #677

Merged
merged 2 commits into from Feb 2, 2021

Conversation

kjvalencik
Copy link
Member

@kjvalencik kjvalencik commented Jan 29, 2021

Currently, if a Root is inside an EventQueue task and the VM is stopped, the user will never have an opportunity to clean up the Root. In this case, it's not a leak because the value will be deleted as the VM exits.

This PR introduces a new IS_RUNNING thread local value. It is initialized as true during module initialization and set to false the first time an EventQueue callback receives a None for Env.

If the value is false, the Drop impl on Root will not panic.

Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

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.

None yet

2 participants