diff options
author | mread <qt-info@nokia.com> | 2011-02-18 16:37:11 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2011-03-09 12:48:31 (GMT) |
commit | b63fa9907a3299f6b9ce158b153941be2b666cc9 (patch) | |
tree | e111dd206f03a70c39932628d2cbd3baf617489b /tests/auto/qthreadstorage | |
parent | b6c60b0c9778f51af8c80f853d840ba25910c6f4 (diff) | |
download | Qt-b63fa9907a3299f6b9ce158b153941be2b666cc9.zip Qt-b63fa9907a3299f6b9ce158b153941be2b666cc9.tar.gz Qt-b63fa9907a3299f6b9ce158b153941be2b666cc9.tar.bz2 |
Fix threadstorage test
The test was not calling the destructor in the test class because the
global static was defined before the destructor was declared.
Task-number: QTBUG-13990
Reviewed-by: Shane Kearns
Diffstat (limited to 'tests/auto/qthreadstorage')
-rw-r--r-- | tests/auto/qthreadstorage/tst_qthreadstorage.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp index a62bfee..2391c81 100644 --- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp @@ -385,19 +385,18 @@ void tst_QThreadStorage::QTBUG14579_leakInDestructor() QCOMPARE(int(SPointer::count), c); } - -class QTBUG14579_reset; -Q_GLOBAL_STATIC(QThreadStorage<QTBUG14579_reset *>, QTBUG14579_resetTls) - class QTBUG14579_reset { public: SPointer member; - ~QTBUG14579_reset() { - //Quite stupid, but WTF::ThreadSpecific<T>::destroy does it. - QTBUG14579_resetTls()->setLocalData(this); - } + ~QTBUG14579_reset(); }; +Q_GLOBAL_STATIC(QThreadStorage<QTBUG14579_reset *>, QTBUG14579_resetTls) + +QTBUG14579_reset::~QTBUG14579_reset() { + //Quite stupid, but WTF::ThreadSpecific<T>::destroy does it. + QTBUG14579_resetTls()->setLocalData(this); +} void tst_QThreadStorage::QTBUG14579_resetInDestructor() { |