Go to file
Bradley T. Hughes f821d6352e Don't release timer ids in event dispatcher code
3rdparty event dispatchers are impossible to write without using the
internal API QAbstractEventDispatcherPrivate::releaseTimerId(). Fix
this by having each QObject keep track of its own timer ids, and
release them when they are no longer used. As a side effect, this
makes the QObjectData::pendTimer bit unnecessary.

This also removes the QObjectData::inThreadChangeEvent hack that the
event dispatchers used to avoid releasing timer ids when moving timers
to a new thread.

QBasicTimer becomes even more low-level. It cannot use
QObject::startTimer() anymore, since we do not have a way to call
QObject::killTimer() from QBasicTimer::stop(). QBasicTimer uses the
QAbstractEventDispatcher interface directly, and releases the timer id
explicitly as well when stopping the timer.

This change also fixes some rare timer id "leaks" when destroying or
stopping timers after a thread has exited and destroyed its event
dispatcher (the timer ids would never be released when no dispatcher
exists).

Globally destructed QObjects that have running timers may try to release
their timer ids after the timer id freelist has been destroyed. This
commit accomodates such objects by avoiding the null dereference in
QAbstractEventDispatcherPrivate::releaseTimerId().

Change-Id: I2d7cd8221fae441f3cf02b6c0b4bc16063834d00
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-04 14:31:57 +01:00
bin fixqt4headers: Add QtCore to folders (for moved item models). 2011-12-20 16:18:27 +01:00
config.tests Fix fvisibility.test for "QMAKE_CXX = ccache g++" 2011-12-18 19:12:42 +01:00
dist Always load the openssl configuration. 2012-01-03 15:12:24 +01:00
doc/src Move snippets from qtdoc. 2011-12-06 22:29:01 +01:00
examples Change the default value of QSortFilterProxyModel::dynamicSortFilter 2012-01-02 16:43:02 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Fix cmake files for static builds. 2011-12-23 17:35:33 +01:00
qmake Remove unused -DQT_NO_PCRE from qmake makefiles 2011-12-23 21:24:25 +01:00
src Don't release timer ids in event dispatcher code 2012-01-04 14:31:57 +01:00
tests Refactor QVariant handlers. 2012-01-04 14:25:25 +01:00
tools configure: Remove -nokia-developer option 2012-01-04 09:58:59 +01:00
util Fix up the accessibility inspector. 2011-12-22 00:47:03 +01:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Add V8 snapshot support 2011-11-22 13:10:56 +01:00
.gitmodules Add QtV8 library to QtBase 2011-08-29 10:16:01 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure configure: Remove -nokia-developer option 2012-01-04 09:58:59 +01:00
configure.exe Rebuild configure.exe. 2011-12-21 22:58:56 +01:00
header.BSD Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
header.FDL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL-ONLY Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
INSTALL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Ensure qmodule.pri is installed. 2011-11-23 00:12:03 +01:00
sync.profile Fix source incompatibility for QVariant{Map, Hash, List} 2011-11-14 18:41:17 +01:00