@@ -105,10 +105,6 @@ class Wrapped {
105105 static GDExtensionBool validate_property_bind (GDExtensionClassInstancePtr p_instance, GDExtensionPropertyInfo *p_property) { return false ; }
106106 static void to_string_bind (GDExtensionClassInstancePtr p_instance, GDExtensionBool *r_is_valid, GDExtensionStringPtr r_out) {}
107107
108- // The only reason this has to be held here, is when we return results of `_get_property_list` to Godot, we pass
109- // pointers to strings in this list. They have to remain valid to pass the bridge, until the list is freed by Godot...
110- ::godot::List<::godot::PropertyInfo> plist_owned;
111-
112108 void _postinitialize ();
113109 virtual void _notificationv (int32_t p_what, bool p_reversed = false ) {}
114110
@@ -156,7 +152,7 @@ _FORCE_INLINE_ Vector<StringName> snarray(P... p_args) {
156152
157153namespace internal {
158154
159- GDExtensionPropertyInfo *create_c_property_list (const ::godot::List<::godot::PropertyInfo> & plist_cpp, uint32_t *r_size);
155+ GDExtensionPropertyInfo *create_c_property_list (::godot::List<::godot::PropertyInfo> * plist_cpp, uint32_t *r_size);
160156void free_c_property_list (GDExtensionPropertyInfo *plist);
161157
162158typedef void (*EngineClassRegistrationCallback)();
@@ -317,16 +313,14 @@ public:
317313 return nullptr ; \
318314 } \
319315 m_class *cls = reinterpret_cast <m_class *>(p_instance); \
320- ::godot::List<::godot::PropertyInfo> &plist_cpp = cls->plist_owned ; \
321- ERR_FAIL_COND_V_MSG (!plist_cpp.is_empty (), nullptr , " Internal error, property list was not freed by engine!" ); \
322- cls->_get_property_list (&plist_cpp); \
316+ ::godot::List<::godot::PropertyInfo> *plist_cpp = memnew (::godot::List<::godot::PropertyInfo>); \
317+ cls->_get_property_list (plist_cpp); \
323318 return ::godot::internal::create_c_property_list (plist_cpp, r_count); \
324319 } \
325320 \
326321 static void free_property_list_bind (GDExtensionClassInstancePtr p_instance, const GDExtensionPropertyInfo *p_list, uint32_t /* p_count*/ ) { \
327322 if (p_instance) { \
328323 m_class *cls = reinterpret_cast <m_class *>(p_instance); \
329- cls->plist_owned .clear (); \
330324 ::godot::internal::free_c_property_list (const_cast <GDExtensionPropertyInfo *>(p_list)); \
331325 } \
332326 } \
0 commit comments