You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, I am working on wrapping some Embree code. One of the things I am looking at is the device handles. The API specifies 3 functions New, Retain, and Release.
Ideally when I bind the device handle, I would like it to use Embree's reference counting under the hood. So if there is a device created in C++ land that is returned to Python, it is not cleaned up until all the references in both python and c++ hit zero. But based on what I have found so far inside Pybind11 I will need to hack it together. So far my only idea is to create a custom holding type that increments when created and decrements when destroyed. What is the proper approach I should take?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi folks, I am working on wrapping some Embree code. One of the things I am looking at is the device handles. The API specifies 3 functions New, Retain, and Release.
Ideally when I bind the device handle, I would like it to use Embree's reference counting under the hood. So if there is a device created in C++ land that is returned to Python, it is not cleaned up until all the references in both python and c++ hit zero. But based on what I have found so far inside Pybind11 I will need to hack it together. So far my only idea is to create a custom holding type that increments when created and decrements when destroyed. What is the proper approach I should take?
Beta Was this translation helpful? Give feedback.
All reactions