Fix a memory leak in QMetaObject::connectSlotsByName function.

QObjectPrivate::Connection time life should be controlled by
QMetaObject::Connection handle.

Change-Id: Ie7fcd950082a3e6cebc29ecc0622007470914edb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Jędrzej Nowacki 2012-03-14 09:06:32 +01:00 committed by Qt by Nokia
parent 087d6c21b8
commit 439a789745

View File

@ -3075,7 +3075,7 @@ void QMetaObject::connectSlotsByName(QObject *o)
}
if (sigIndex < 0)
continue;
if (QMetaObjectPrivate::connect(co, sigIndex, o, i)) {
if (Connection(QMetaObjectPrivate::connect(co, sigIndex, o, i))) {
foundIt = true;
break;
}