Add ClassDB::has_instance_binding_callbacks() and check before getting callbacks in internal::get_object_instance_binding()#1223
Conversation
a8e18ee to
6a7b970
Compare
|
Thanks! Can you give some more details about the behavior you're getting from
In what way is it invalid? I'd really love for |
|
Oh, my mistake, it will print an error but return a valid In src/core/object.cpp, line 53. |
…t_instance_binding_callables() in internal::get_object_instance_binding()
6a7b970 to
ba59a2a
Compare
ClassDB::has_instance_binding_callbacks()ClassDB::has_instance_binding_callbacks() and check before getting callbacks in internal::get_object_instance_binding()
|
@dsnopek By the way, if I want to be a author in "AUTHORS.md", should I have be merged at least 11 commits only in godot repo? Or my commits in this repo will be counted, too? |
I just asked internally and only commits to the main Godot repo are counted. However, you've made some really great GDExtension contributions, both to Godot and godot-cpp - Thank You So Much! I think you'll get there eventually :-) |
|
Thanks for your reply! |
Ah, ok, thanks for the clarification!
Hm, I'm not sure that's what we want to do. There may be classes added to Godot after the creation of the GDExtension, which won't be listed in the instance bindings. In that case, we probably do want an See #1165 |
|
Issue is fixed by #1165. |
In my case, I need to get all singletons from
Engine::get_singleton()->get_singleton(), but if it has not instance callbacks, it will print a errorand return a invalid object.I add
ClassDB::has_instance_binding_callbacks()to check if it is available or not.I think this is beneficial to do some reflection operations like in C#, so I open this pr.