Skip to content

Fix application of keep_alive policy to constructors (regression) #1065

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

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

dean0x7d
Copy link
Member

@dean0x7d dean0x7d commented Sep 4, 2017

The regression was introduced in #1014 where the constructor's self argument became value_and_holder instead of the instance itself, so the keep_alive policy stoped binding to the created instance. This PR fixes it by stashing the original self instance in function_call (only for constructor calls).

This also adds a quick paragraph to the docs to clear up argument indexing of constructors.

@dean0x7d dean0x7d modified the milestone: v2.2.1 Sep 4, 2017
@jagerman
Copy link
Member

jagerman commented Sep 5, 2017

I was just about to ask about creating a v2.2.1 milestone, but I see that's already done.

The fix looks good to me.

@dean0x7d dean0x7d merged commit 7939f4b into pybind:master Sep 6, 2017
@dean0x7d dean0x7d deleted the fix-keep_alive-ctor branch September 6, 2017 08: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.

2 participants