Don't call parent _get_property_list when a class doesn't define it (for internal binding). #1184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes part of #1183
Related to godotengine/godot#79683, the pair fixes #1183 completely.
Godot is already supposed to call
_get_property_list
of parent classes, so the binding function (get_property_list_bind
) must really only return procedural properties of the class it belongs to, and not parent or child classes, just like core does.So in fact, it is possible to simply pass null to Godot when
_get_property_list
is not defined in the class.I also found out a few members of
Wrapped
weren't necessary, and was able to move some of the code away from theGDCLASS
macro.I believe there is a way to also not need
plist_owned
insideWrapped
, maybe storing it in athread_local
, which would also fix potential issues ifget_property_list
is called from multiple threads. Maybe it even allows to move more things away from the macro, but I haven't gone to that extent in this PR.There is also an issue with
GDExtensionClassFreePropertyList
: it is pretty much the "free" for the non-const pointer returned byGDExtensionClassGetPropertyList
, but it receives the pointer asconst
, so it can't be freed withoutconst_cast
, looks like an oversight.