Move QThread::currentThreadId() down to the loop using it.

This prevents the call from happening in case no C++ signal is
connected.

Change-Id: I32027df446391f3fc979528738a106223042d632
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Erik Verbruggen 2016-04-05 17:01:11 +02:00
parent 1735ca57a8
commit 9d0dbc32dd

View File

@ -3628,8 +3628,6 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
argv ? argv : empty_argv);
}
Qt::HANDLE currentThreadId = QThread::currentThreadId();
{
QMutexLocker locker(signalSlotLock(sender));
struct ConnectionListsRef {
@ -3668,6 +3666,8 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
else
list = &connectionLists->allsignals;
Qt::HANDLE currentThreadId = QThread::currentThreadId();
do {
QObjectPrivate::Connection *c = list->first;
if (!c) continue;