diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-22 22:09:43 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-22 22:09:43 (GMT) |
commit | 774a8ff7444001917287524ac57d370c6995dea0 (patch) | |
tree | 9adc84541d1fbe9226e08871979874422c253918 /doc | |
parent | 3fa2a510aae1e0c5e18f3b6962c54fae92f3d176 (diff) | |
parent | 360f596183969a4c690c77df08d94101428c97c0 (diff) | |
download | Qt-774a8ff7444001917287524ac57d370c6995dea0.zip Qt-774a8ff7444001917287524ac57d370c6995dea0.tar.gz Qt-774a8ff7444001917287524ac57d370c6995dea0.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
optimize ligatureHelper by using qBinaryFind instead of the for loop
QFileSystemWatcher: Do not require QApplication in the destructor.
Do not define METHOD if QT_NO_KEYWORD is defined.
QThreadPrivate::finish should not keep mutex locked when calling signals
Make QThreadStorage supports value type and not only pointers.
QThreadStorage: fix memory leak if thread storage are added while destroying
Compile fix.
Fix some warnings on Mac
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/snippets/threads/threads.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/doc/src/snippets/threads/threads.cpp b/doc/src/snippets/threads/threads.cpp index d8d1270..d16c398 100644 --- a/doc/src/snippets/threads/threads.cpp +++ b/doc/src/snippets/threads/threads.cpp @@ -93,15 +93,12 @@ private: typedef int SomeClass; //! [7] -QThreadStorage<QCache<QString, SomeClass> *> caches; +QThreadStorage<QCache<QString, SomeClass> > caches; void cacheObject(const QString &key, SomeClass *object) //! [7] //! [8] { - if (!caches.hasLocalData()) - caches.setLocalData(new QCache<QString, SomeClass>); - - caches.localData()->insert(key, object); + caches.localData().insert(key, object); } void removeFromCache(const QString &key) @@ -110,7 +107,7 @@ void removeFromCache(const QString &key) if (!caches.hasLocalData()) return; - caches.localData()->remove(key); + caches.localData().remove(key); } //! [9] |