From 0dd6079e4e4bc773c01bb85858d0a56b5b756d8f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 17 Dec 2019 11:18:27 -0300 Subject: [PATCH] Improve error message and do not spam forever. --- core/object.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/object.cpp b/core/object.cpp index 8dde03f0e7e..e1bc4b97f0e 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1950,7 +1950,10 @@ Object::~Object() { Signal *s = &signal_map[*S]; - ERR_CONTINUE_MSG(s->lock > 0, "Attempt to delete an object in the middle of a signal emission from it."); + if (s->lock > 0) { + //@todo this may need to actually reach the debugger prioritarily somehow because it may crash before + ERR_PRINTS("Object was freed or unreferenced while signal '" + String(*S) + "' is being emitted from it. Try connecting to the signal using 'CONNECT_DEFERRED' flag, or use queue_free() to free the object (if this object is a Node) to avoid this error and potential crashes."); + } //brute force disconnect for performance int slot_count = s->slot_map.size();