Fix Container sorting not working when overriding _sort_children in gdscript
Remove _sort_children from script bindings: _sort_children is an internal method which shouldn't be exposed to scripts. Added support for non-bound methods in MessageQueue: So we can use deferred calls without exposing internal methods to scripts. Added debug checks in CallableCustomMethodPointer: Adding method pointer callables to the message queue was causing crashes in case an object was destroyed and the same memory was allocated for another one. The new object had a valid object id but the call was erroneous. Release will be fixed later, along with Variant which has the same problem and is also fixed for debug only.
This commit is contained in:
parent
d999071edf
commit
3ad694018f
4 changed files with 51 additions and 5 deletions
|
|
@ -140,7 +140,7 @@ void Container::queue_sort() {
|
|||
return;
|
||||
}
|
||||
|
||||
MessageQueue::get_singleton()->push_call(this, "_sort_children");
|
||||
MessageQueue::get_singleton()->push_callable(callable_mp(this, &Container::_sort_children));
|
||||
pending_sort = true;
|
||||
}
|
||||
|
||||
|
|
@ -177,8 +177,6 @@ String Container::get_configuration_warning() const {
|
|||
}
|
||||
|
||||
void Container::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_sort_children"), &Container::_sort_children);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("queue_sort"), &Container::queue_sort);
|
||||
ClassDB::bind_method(D_METHOD("fit_child_in_rect", "child", "rect"), &Container::fit_child_in_rect);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue