Revert "Let user know about dead instances in deferred calls"

This reverts commit 3a6527d6d3.
This commit is contained in:
clayjohn 2023-07-31 10:45:20 +02:00
parent 262d1eaa63
commit fcc6c6a697

View File

@ -35,10 +35,6 @@
#include "core/object/class_db.h" #include "core/object/class_db.h"
#include "core/object/script_language.h" #include "core/object/script_language.h"
#ifdef DEBUG_ENABLED
#include "core/config/engine.h"
#endif
#ifdef DEV_ENABLED #ifdef DEV_ENABLED
// Includes sanity checks to ensure that a queue set as a thread singleton override // Includes sanity checks to ensure that a queue set as a thread singleton override
// is only ever called from the thread it was set for. // is only ever called from the thread it was set for.
@ -320,34 +316,25 @@ Error CallQueue::flush() {
Object *target = message->callable.get_object(); Object *target = message->callable.get_object();
UNLOCK_MUTEX; UNLOCK_MUTEX;
#ifdef DEBUG_ENABLED
if (!message->callable.is_valid()) { switch (message->type & FLAG_MASK) {
// The editor would cause many of these. case TYPE_CALL: {
if (!Engine::get_singleton()->is_editor_hint()) { if (target || (message->type & FLAG_NULL_IS_OK)) {
ERR_PRINT("Trying to execute a deferred call/notification/set on a previously freed instance. Consider using queue_free() instead of free()."); Variant *args = (Variant *)(message + 1);
} _call_function(message->callable, args, message->args, message->type & FLAG_SHOW_ERROR);
} else }
#endif } break;
{ case TYPE_NOTIFICATION: {
switch (message->type & FLAG_MASK) { if (target) {
case TYPE_CALL: { target->notification(message->notification);
if (target || (message->type & FLAG_NULL_IS_OK)) { }
Variant *args = (Variant *)(message + 1); } break;
_call_function(message->callable, args, message->args, message->type & FLAG_SHOW_ERROR); case TYPE_SET: {
} if (target) {
} break; Variant *arg = (Variant *)(message + 1);
case TYPE_NOTIFICATION: { target->set(message->callable.get_method(), *arg);
if (target) { }
target->notification(message->notification); } break;
}
} break;
case TYPE_SET: {
if (target) {
Variant *arg = (Variant *)(message + 1);
target->set(message->callable.get_method(), *arg);
}
} break;
}
} }
if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION) { if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION) {