From dd59aaada04f3f0d465abc84028ca3d4d1df48f7 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Tue, 26 Feb 2013 16:27:44 +0100 Subject: [PATCH] Delete closures if the receiver is deleted. --- ext/libclementine-common/core/closure.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/libclementine-common/core/closure.h b/ext/libclementine-common/core/closure.h index ca0081109..63ed9936b 100644 --- a/ext/libclementine-common/core/closure.h +++ b/ext/libclementine-common/core/closure.h @@ -100,6 +100,7 @@ class Closure : public ClosureBase { const int index = meta_receiver->indexOfSlot(normalised_slot.constData()); Q_ASSERT(index != -1); slot_ = meta_receiver->method(index); + QObject::connect(receiver_, SIGNAL(destroyed()), helper_, SLOT(deleteLater())); } virtual void Invoke() {