summaryrefslogtreecommitdiffstats
path: root/src/corelib/concurrent/qthreadpool.cpp
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-06-10 13:46:23 +0200
committerRobert Griebl <rgriebl@trolltech.com>2009-06-10 13:46:23 +0200
commit7604f8087f88171ef933d8ae08f501467e647338 (patch)
tree51d071f462ed48d0b25884d9f62b8ba11c5dff13 /src/corelib/concurrent/qthreadpool.cpp
parent8c265860b41214daade7c8a28237c1e07ea71a3c (diff)
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels
Diffstat (limited to 'src/corelib/concurrent/qthreadpool.cpp')
-rw-r--r--src/corelib/concurrent/qthreadpool.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/concurrent/qthreadpool.cpp
index 30edfd4eff..8913b5618a 100644
--- a/src/corelib/concurrent/qthreadpool.cpp
+++ b/src/corelib/concurrent/qthreadpool.cpp
@@ -246,14 +246,14 @@ bool QThreadPoolPrivate::tooManyThreadsActive() const
*/
void QThreadPoolPrivate::startThread(QRunnable *runnable)
{
- QThreadPoolThread *thread = new QThreadPoolThread(this);
- allThreads.insert(thread);
+ QScopedPointer <QThreadPoolThread> thread(new QThreadPoolThread(this));
+ allThreads.insert(thread.data());
++activeThreads;
if (runnable->autoDelete())
++runnable->ref;
thread->runnable = runnable;
- thread->start();
+ thread.take()->start();
}
/*! \internal