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

Redesign holder types #74

Merged
merged 2 commits into from
Dec 22, 2020
Merged

Conversation

jnbrunet
Copy link
Collaborator

This PR make use of a custom py_shared_ptr holder type that will hold
the virtual pointers to SOFA objects (inheriting from Base). The holder
also keeps an internal copy of the initial python object to avoid slicing
when the latter gets deleted by python before the C++ wrapper.

This commit also brings several clean-up to the overall source code of the
bindings.

fredroy and others added 2 commits December 15, 2020 21:53
This commit make use of a custom py_shared_ptr holder type that will hold
the virtual pointers to SOFA objects (inheriting from Base). The holder
also keeps an internal copy of the initial python object to avoid slicing
when the latter gets deleted by python before the C++ wrapper.

This commit also brings several cleanup to the overall source code of the
bindings.
@jnbrunet jnbrunet added this to the V20.12 milestone Dec 21, 2020
@jnbrunet jnbrunet self-assigned this Dec 21, 2020
@fredroy fredroy merged commit 3e7589c into sofa-framework:master Dec 22, 2020
@jnbrunet jnbrunet deleted the redesign_holder_types branch December 23, 2020 07:19
damienmarchal added a commit to CRIStAL-PADR/plugin.SofaPython3 that referenced this pull request Apr 11, 2022
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.
fredroy pushed a commit that referenced this pull request Apr 13, 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.

The PR fix this.
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.

None yet

2 participants