Skip to content

Conversation

@damienmarchal
Copy link
Contributor

@damienmarchal damienmarchal commented Apr 11, 2022

The object created from python needs special care to avoid being deleted by the python garbage collection mecanisme.
In #74 and #75 the smart pointer mecanism was refactored. The refactoring added a py::keep_alive, in addObject but didn't in other functions like addChild and createObject/createChild.

Not havin this has the consequence that the python side of c++ object is gc'ed.
The PR adds the missing ones.

Fix #245

The object created from python needs special care to avoid being deleted by
the python garbage collection mecanisme.
In sofa-framework#74 and sofa-framework#75 the smart pointer mecanism was refactored. The refactoring
added a py::keep_alive, in addObject but didn't in other functions.

The PR fix this.
@damienmarchal damienmarchal changed the title [SOOaPython/Binding] Add py::keep_alive in Binding_Node.cpp [SofaaPython/Binding] Add py::keep_alive in Binding_Node.cpp Apr 11, 2022
@damienmarchal damienmarchal changed the title [SofaaPython/Binding] Add py::keep_alive in Binding_Node.cpp [SofaaPython/Binding] Add py::keep_alive in Binding_Node.cpp (FIX issue #245) Apr 11, 2022
@fredroy fredroy merged commit 98c8cb2 into sofa-framework:master Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The python part of overloaded objects are deleted

2 participants