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

Manage teardown with shared_ptr not CountDownLatch #38

Merged
merged 1 commit into from Apr 8, 2024

Conversation

bpcreech
Copy link
Owner

@bpcreech bpcreech commented Apr 8, 2024

It's hard to manage object lifecycle in the C++ side of PyMiniRacer because objects are often referenced in callbacks sent into the Isolate message pump. Before we tried to explicitly manage lifecycle, and used a CountDownLatch to ensure all the async work was done before closing out the Isolate. In this change, we just switch everything to shared_ptr and let the Isolate shut itself down when nothing else refers to it.

@bpcreech bpcreech force-pushed the feature/shared-ptr branch 2 times, most recently from 6c76bd8 to 3ddda40 Compare April 8, 2024 14:52
It's hard to manage object lifecycle in the C++ side of PyMiniRacer
because objects are often referenced in callbacks sent into the Isolate
message pump. Before we tried to explicitly manage lifecycle, and used
a CountDownLatch to ensure all the async work was done before closing
out the Isolate. In this change, we just switch everything to shared_ptr
and let the Isolate shut itself down when nothing else refers to it.
@bpcreech bpcreech merged commit 612b0da into main Apr 8, 2024
9 checks passed
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

1 participant