summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-07-31 10:45:20 +0200
committerclayjohn <claynjohn@gmail.com>2023-07-31 10:45:20 +0200
commitfcc6c6a6975173c5cd59c2c3021f141157be6469 (patch)
tree639fcdc87274ce8ed86849f0b6761056ef96c6df
parent262d1eaa631e9cefc3f6f09845579cef2af37576 (diff)
downloadredot-engine-fcc6c6a6975173c5cd59c2c3021f141157be6469.tar.gz
Revert "Let user know about dead instances in deferred calls"
This reverts commit 3a6527d6d3c15bc052b9f27ccb1b4ad7c10c135f.
-rw-r--r--core/object/message_queue.cpp51
1 files changed, 19 insertions, 32 deletions
diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp
index dd7aba1384..506f8291eb 100644
--- a/core/object/message_queue.cpp
+++ b/core/object/message_queue.cpp
@@ -35,10 +35,6 @@
#include "core/object/class_db.h"
#include "core/object/script_language.h"
-#ifdef DEBUG_ENABLED
-#include "core/config/engine.h"
-#endif
-
#ifdef DEV_ENABLED
// 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.
@@ -320,34 +316,25 @@ Error CallQueue::flush() {
Object *target = message->callable.get_object();
UNLOCK_MUTEX;
-#ifdef DEBUG_ENABLED
- if (!message->callable.is_valid()) {
- // The editor would cause many of these.
- if (!Engine::get_singleton()->is_editor_hint()) {
- ERR_PRINT("Trying to execute a deferred call/notification/set on a previously freed instance. Consider using queue_free() instead of free().");
- }
- } else
-#endif
- {
- switch (message->type & FLAG_MASK) {
- case TYPE_CALL: {
- if (target || (message->type & FLAG_NULL_IS_OK)) {
- Variant *args = (Variant *)(message + 1);
- _call_function(message->callable, args, message->args, message->type & FLAG_SHOW_ERROR);
- }
- } break;
- case TYPE_NOTIFICATION: {
- if (target) {
- target->notification(message->notification);
- }
- } break;
- case TYPE_SET: {
- if (target) {
- Variant *arg = (Variant *)(message + 1);
- target->set(message->callable.get_method(), *arg);
- }
- } break;
- }
+
+ switch (message->type & FLAG_MASK) {
+ case TYPE_CALL: {
+ if (target || (message->type & FLAG_NULL_IS_OK)) {
+ Variant *args = (Variant *)(message + 1);
+ _call_function(message->callable, args, message->args, message->type & FLAG_SHOW_ERROR);
+ }
+ } break;
+ case TYPE_NOTIFICATION: {
+ if (target) {
+ target->notification(message->notification);
+ }
+ } 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) {