From 16a42dff7db80813c69527e7f44ec1ca6e6371cb Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 26 Sep 2018 00:47:14 +0200 Subject: [PATCH] common: Avoid crash on SignalProxy destruction Since SignalProxy itself attaches a slot, it will try to detach itself on destruction, leading to a crash. Avoid this by checking for self-detachment. --- src/common/signalproxy.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index 3ac73bc0..5e5f59d4 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -475,8 +475,11 @@ void SignalProxy::synchronize(SyncableObject *obj) void SignalProxy::detachObject(QObject *obj) { - detachSignals(obj); - detachSlots(obj); + // Don't try to connect SignalProxy from itself on shutdown + if (obj != this) { + detachSignals(obj); + detachSlots(obj); + } } -- 2.20.1