Revert "[smart_holder] Keep parent alive when returning raw pointers (#4609)"

This reverts commit 99cf27a4f5.
This commit is contained in:
Ralf W. Grosse-Kunstleve
2024-06-10 18:56:44 -07:00
committed by Ralf W. Grosse-Kunstleve
parent 7d8e6ea5b9
commit bfb5fce463
3 changed files with 1 additions and 66 deletions

View File

@@ -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
}