diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-12 08:33:33 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-12 08:40:45 (GMT) |
commit | b3b2bc3f190d80e30b968648dd91048df67b8a50 (patch) | |
tree | 65b0d075d2be2addb55aa7baf6af58a8154abbe6 /src/corelib/kernel/qobject.cpp | |
parent | 62aa09a47cc226518d42f1b3b2337fdcb440da33 (diff) | |
download | Qt-b3b2bc3f190d80e30b968648dd91048df67b8a50.zip Qt-b3b2bc3f190d80e30b968648dd91048df67b8a50.tar.gz Qt-b3b2bc3f190d80e30b968648dd91048df67b8a50.tar.bz2 |
Possible Dead lock in the destructor of QObject
The problem was that we were locking a mutex that was global to thread
to remove posted events associated with a QObject from the posted event
list. We were also immediately deleting those events. If that triggers
the deletion of another QObject, you would then trigger a dead-lock.
Task-number: 259514
Reviewed-by: brad
Reviewed-by: ogoffart
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 3902825..2afab1a 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -896,10 +896,7 @@ QObject::~QObject() qt_removeObject(this); - QMutexLocker locker2(&d->threadData->postEventList.mutex); - if (d->postedEvents > 0) - QCoreApplicationPrivate::removePostedEvents_unlocked(this, 0, d->threadData); - locker2.unlock(); + QCoreApplication::removePostedEvents(this); if (d->parent) // remove it from parent object d->setParent_helper(0); |