Skip to content

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 force-pushed the feature/shared-ptr branch from 3ddda40 to c0efb43 Compare April 8, 2024 17:50
@bpcreech bpcreech merged commit 612b0da into main Apr 8, 2024
@bpcreech bpcreech deleted the feature/shared-ptr branch May 27, 2024 21:26
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