@@ -72,6 +72,9 @@ struct smart_holder_type_caster_disown_load {
7272
7373 if (self_life_support != nullptr ) {
7474 self_life_support->activate_life_support (load_impl.loaded_v_h );
75+ } else {
76+ load_impl.loaded_v_h .value_ptr () = nullptr ;
77+ deregister_instance (load_impl.loaded_v_h .inst , value_void_ptr, load_impl.loaded_v_h .type );
7578 }
7679
7780 return raw_type_ptr;
@@ -87,8 +90,10 @@ private:
8790 T *convert_type (void *void_ptr) const
8891 {
8992 if (void_ptr != nullptr && load_impl.loaded_v_h_cpptype != nullptr && !load_impl.reinterpret_cast_deemed_ok &&
90- load_impl.implicit_cast != nullptr ) {
91- void_ptr = load_impl.implicit_cast (void_ptr);
93+ !load_impl.implicit_casts .empty ()) {
94+ for (auto implicit_cast : load_impl.implicit_casts ) {
95+ void_ptr = implicit_cast (void_ptr);
96+ }
9297 }
9398 return static_cast <T *>(void_ptr);
9499 }
@@ -98,7 +103,7 @@ template <typename T>
98103struct smart_holder_type_caster <disown_ptr<T>> : smart_holder_type_caster_disown_load<T>,
99104 smart_holder_type_caster_class_hooks {
100105
101- static constexpr auto name = _ <T>();
106+ static constexpr auto name = const_name <T>();
102107
103108 static handle cast (disown_ptr<T> &&, return_value_policy, handle)
104109 {
@@ -119,7 +124,7 @@ struct smart_holder_type_caster<disown_ptr<T>> : smart_holder_type_caster_disown
119124template <typename T>
120125struct smart_holder_type_caster <disown_ptr<T const >> : smart_holder_type_caster_class_hooks {
121126
122- static constexpr auto name = _ <T>();
127+ static constexpr auto name = const_name <T>();
123128
124129 static handle cast (disown_ptr<T const > &&, return_value_policy, handle)
125130 {
0 commit comments