From 04e5b338c455d8996c84f5b2cc9573c99925f478 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 26 Jun 2013 12:03:24 +0200 Subject: [PATCH] Add comment to prevent others from doing the same mistake --- src/libtomahawk/utils/WeakObjectHash.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libtomahawk/utils/WeakObjectHash.h b/src/libtomahawk/utils/WeakObjectHash.h index 0845bc133..0de08e607 100644 --- a/src/libtomahawk/utils/WeakObjectHash.h +++ b/src/libtomahawk/utils/WeakObjectHash.h @@ -66,6 +66,7 @@ public: void insert( const QString& key, const QSharedPointer& value ) { + // Do not pass the QSharedPointer to the closure as this will prevent the object from being destroyed. _detail::Closure* cl = NewClosure( value.data(), SIGNAL( destroyed( QObject* ) ), &m_private, SLOT( remove( QString ) ), key ); cl->setAutoDelete( true ); m_hash.insert( key, value.toWeakRef() );