qt5base-lts/tests/auto/corelib/kernel
Thiago Macieira 950b35cf97 Clear the current thread data for the main thread
This avoids crashes accessing deleted memory when creating a QObject
after the last QObject had been deleted, like a qDebug() in global
destructors.

==41000== Invalid read of size 4
==41000==    at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208)
==41000==    by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147)
==41000==    by 0x5F24051: QThreadData::ref() (qthread.cpp:100)
==41000==    by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681)
==41000==  Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd
==41000==    at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480)
==41000==    by 0x5F240BF: QThreadData::deref() (qthread.cpp:109)
==41000==    by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268)

The comment right above the change in qthread.cpp looks eerily similar
to the problem I'm trying to fix. However, the actual change that
introduced the change is not in the Qt public history, so we can't
know for sure what the problem was then.

Change-Id: I0dba895b041fe6cf81e6f8939ca85035cd00aad1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-03-05 20:58:00 +01:00
..
qcoreapplication Clear the current thread data for the main thread 2013-03-05 20:58:00 +01:00
qeventdispatcher Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qeventloop Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qmath Add qDegreesToRadians and qRadiansToDegrees math functions 2013-02-05 14:40:14 +01:00
qmetamethod Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qmetaobject Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qmetaobjectbuilder Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qmetaproperty Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qmetatype Fix QMetaType of const references 2013-02-21 14:54:00 +01:00
qmimedata tests: Fix some more old references and links to Nokia 2013-02-01 15:27:37 +01:00
qobject Add private API to connect to slots in QObjectPrivate 2013-02-28 19:22:05 +01:00
qpointer Make it possible to use QPointer<const T> 2013-02-13 15:15:56 +01:00
qsharedmemory Fix minor typos in docs, printed messages & comments 2013-01-28 18:12:41 +01:00
qsignalmapper Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qsocketnotifier Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qsystemsemaphore Check existence of QProcess feature before using it on Qt autotests. 2013-01-28 16:06:15 +01:00
qtimer Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qtranslator Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qvariant tests: Fix some more old references and links to Nokia 2013-02-01 15:27:37 +01:00
qwineventnotifier Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
kernel.pro Check for network module when building according auto tests 2013-02-19 19:20:53 +01:00