1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-06 06:03:23 +01:00

Delete closures if the receiver is deleted.

This commit is contained in:
John Maguire 2013-02-26 16:27:44 +01:00
parent 160d9edfb6
commit dd59aaada0

View File

@ -100,6 +100,7 @@ class Closure : public ClosureBase {
const int index = meta_receiver->indexOfSlot(normalised_slot.constData()); const int index = meta_receiver->indexOfSlot(normalised_slot.constData());
Q_ASSERT(index != -1); Q_ASSERT(index != -1);
slot_ = meta_receiver->method(index); slot_ = meta_receiver->method(index);
QObject::connect(receiver_, SIGNAL(destroyed()), helper_, SLOT(deleteLater()));
} }
virtual void Invoke() { virtual void Invoke() {