Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
9b880ba7
Commit
9b880ba7
authored
Apr 25, 2016
by
Wenzel Jakob
Browse files
keep_alive: don't fail when there is no patient
parent
7d0162a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+3
-0
No files found.
include/pybind11/pybind11.h
View file @
9b880ba7
...
...
@@ -982,6 +982,9 @@ PYBIND11_NOINLINE inline void keep_alive_impl(int Nurse, int Patient, handle arg
if
(
!
nurse
||
!
patient
)
pybind11_fail
(
"Could not activate keep_alive!"
);
if
(
patient
.
ptr
()
==
Py_None
)
return
;
/* Nothing to keep alive */
cpp_function
disable_lifesupport
(
[
patient
](
handle
weakref
)
{
patient
.
dec_ref
();
weakref
.
dec_ref
();
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment