Skip to content

Commit ac840cf

Browse files
committed
fix: avoid copy constructor instantiation in shared_ptr fallback cast
1 parent b2af83a commit ac840cf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/pybind11/cast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,8 @@ struct copyable_holder_caster<
10271027
}
10281028

10291029
if (parent) {
1030-
return type_caster_base<type>::cast(
1031-
srcs, return_value_policy::reference_internal, parent);
1030+
return type_caster_generic::cast(
1031+
srcs, return_value_policy::reference_internal, parent, nullptr, nullptr);
10321032
}
10331033

10341034
throw cast_error("Unable to convert std::shared_ptr<T> to Python when the bound type "

0 commit comments

Comments
 (0)