mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 09:17:42 +00:00
Revert "[smart_holder] Keep parent alive when returning raw pointers (#4609)"
This reverts commit 99cf27a4f5.
This commit is contained in:
committed by
Ralf W. Grosse-Kunstleve
parent
7d8e6ea5b9
commit
bfb5fce463
@@ -788,11 +788,7 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>,
|
||||
|
||||
static handle cast(T *src, return_value_policy policy, handle parent) {
|
||||
if (policy == return_value_policy::_clif_automatic) {
|
||||
if (parent) {
|
||||
policy = return_value_policy::reference_internal;
|
||||
} else {
|
||||
policy = return_value_policy::reference;
|
||||
}
|
||||
policy = return_value_policy::reference;
|
||||
}
|
||||
return cast(const_cast<T const *>(src), policy, parent); // Mutbl2Const
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user