From ffd85b46d817c6840e57f870144520703cadd020 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 30 Apr 2016 22:41:05 +0200 Subject: [PATCH] return value policy fix for functions returning std::shared_ptr<> (fixes #187) --- include/pybind11/cast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index b5b3ae09..481c78a4 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -720,7 +720,7 @@ public: static handle cast(const holder_type &src, return_value_policy policy, handle parent) { return type_caster_generic::cast( - src.get(), policy, parent, + src.get(), return_value_policy::take_ownership, parent, src.get() ? &typeid(*src.get()) : nullptr, &typeid(type), ©_constructor, &move_constructor, &src); }