We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a4a6fb commit 32b7f83Copy full SHA for 32b7f83
core/object/object.cpp
@@ -2097,7 +2097,11 @@ Object::~Object() {
2097
// Disconnect signals that connect to this object.
2098
while (connections.size()) {
2099
Connection c = connections.front()->get();
2100
- bool disconnected = c.signal.get_object()->_disconnect(c.signal.get_name(), c.callable, true);
+ Object *obj = c.callable.get_object();
2101
+ bool disconnected = false;
2102
+ if (likely(obj)) {
2103
+ disconnected = c.signal.get_object()->_disconnect(c.signal.get_name(), c.callable, true);
2104
+ }
2105
if (unlikely(!disconnected)) {
2106
// If the disconnect has failed, abandon the connection to avoid getting trapped in an infinite loop here.
2107
connections.pop_front();
0 commit comments