diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index b85b65e6d95f..6970349414af 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1813,8 +1813,9 @@ void CSharpInstance::get_event_signals_state_for_reloading(List *p_properties) const { + List props; for (OrderedHashMap::ConstElement E = script->member_info.front(); E; E = E.next()) { - p_properties->push_front(E.value()); + props.push_front(E.value()); } // Call _get_property_list @@ -1837,15 +1838,19 @@ void CSharpInstance::get_property_list(List *p_properties) const { if (ret) { Array array = Array(GDMonoMarshal::mono_object_to_variant(ret)); for (int i = 0, size = array.size(); i < size; i++) { - p_properties->push_back(PropertyInfo::from_dict(array.get(i))); + props.push_back(PropertyInfo::from_dict(array.get(i))); } } - return; + break; } top = top->get_parent_class(); } + + for (const PropertyInfo &prop : props) { + p_properties->push_back(prop); + } } Variant::Type CSharpInstance::get_property_type(const StringName &p_name, bool *r_is_valid) const { @@ -3499,8 +3504,14 @@ Ref