qt5base-lts/tests/auto/corelib/kernel
Kari Oikarinen a952fd7d5b QObject: Fix isSignalConnected() when signals have been disconnected
The bitmap cache for the first 64 signals being connected was only set when the
connection is added. It was never unset when the connection was removed.

Internal use of the connectedSignals bitmap is not hurt by it occasionally
saying a signal is connected even though it is not, since the purpose of those
checks is avoiding expensive operations that are not necessary if nothing is
connected to the signal.

However, the public API using this cache meant that it also never spotted
signals being disconnected. This was not documented. Fix the behavior by only
using the cache if it is up to date. If it is not, use a slower path that gives
the correct answer.

To avoid making disconnections and QObject destructions slower, the cache is
only updated to unset disconnected signals when new signal connections are
added. No extra work is done in the common case where signals are only
removed in the end of the QObject's lifetime.

Fixes: QTBUG-32340
Change-Id: Ieb6e498060157153cec60d9c8f1c33056993fda1
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-10-31 10:32:41 +00:00
..
qcoreapplication Modernize the "thread" feature 2018-08-17 00:34:36 +00:00
qdeadlinetimer Increase the resolution for QDeadlineTimer unit test 2016-10-26 03:16:26 +00:00
qelapsedtimer Extend blacklisting of tst_QElapsedTimer::elapsed to cover macOS 10.13 2018-07-31 05:02:30 +00:00
qeventdispatcher tst_qeventdispatcher: remove macOS from the BLACKLIST 2018-10-25 11:51:53 +00:00
qeventloop tst_QEventLoop: Remove unconditional qWait() 2018-04-10 08:32:21 +00:00
qmath Be (somewhat more) consistent about the value of pi 2017-06-20 09:53:46 +00:00
qmetaenum QMetaEnum: fix UB 2018-10-17 08:48:13 +00:00
qmetamethod Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qmetaobject Add debug output for single enum flags 2018-08-11 20:09:55 +00:00
qmetaobjectbuilder Fix QMetaObject naming of class enum flag 2018-08-11 07:59:15 +00:00
qmetaproperty Updated license headers 2016-01-21 18:55:18 +00:00
qmetatype Update QMetaObjectBuilder::MetaObjectFlag enum 2018-08-30 05:12:01 +00:00
qmimedata Updated license headers 2016-01-21 18:55:18 +00:00
qobject QObject: Fix isSignalConnected() when signals have been disconnected 2018-10-31 10:32:41 +00:00
qpointer Merge remote-tracking branch 'origin/5.6' into 5.7 2016-04-04 08:59:18 +02:00
qsharedmemory tst_qsharedmemory: Use qt_test_helper functionality 2018-07-31 05:26:59 +00:00
qsignalblocker Updated license headers 2016-01-21 18:55:18 +00:00
qsignalmapper Updated license headers 2016-01-21 18:55:18 +00:00
qsocketnotifier winrt: Fix tst_QSocketNotifier::asyncMultipleDatagram 2017-05-11 06:37:36 +00:00
qsystemsemaphore tst_qsystemsemaphore: Use qt_test_helper functionality 2018-07-31 05:27:08 +00:00
qtimer Rename QTimer::connectTo() to QTimer::callOnTimeout() 2018-09-03 08:43:39 +00:00
qtranslator Allow loading of empty translation files 2018-07-12 08:54:33 +00:00
qvariant Merge remote-tracking branch 'origin/dev' into 5.11 2018-02-10 15:55:52 +01:00
qwineventnotifier Merge remote-tracking branch 'origin/5.11' into dev 2018-03-28 08:12:21 +02:00
kernel.pro Make tests compile for Android 2018-06-25 08:01:19 +00:00