diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-02 17:56:00 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-03-09 12:48:39 (GMT) |
commit | 270b878729068f42f862c7d04bb8a13915801ba3 (patch) | |
tree | 084052735a608ebe7e6e199559fe25a961c2c8b6 /src/network/socket | |
parent | 9530b97c6024ac69011ceb70dde06f5c71bd31d9 (diff) | |
download | Qt-270b878729068f42f862c7d04bb8a13915801ba3.zip Qt-270b878729068f42f862c7d04bb8a13915801ba3.tar.gz Qt-270b878729068f42f862c7d04bb8a13915801ba3.tar.bz2 |
Thread safety - close RTimer handle when moving threads
RTimer is only usable in the thread it was created.
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qsymbiansocketengine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp index dac50d4..fa6aedd 100644 --- a/src/network/socket/qsymbiansocketengine.cpp +++ b/src/network/socket/qsymbiansocketengine.cpp @@ -1665,16 +1665,26 @@ qint64 QSymbianSocketEngine::bytesToWrite() const bool QSymbianSocketEngine::event(QEvent* ev) { Q_D(QSymbianSocketEngine); +#ifdef QNATIVESOCKETENGINE_DEBUG + qDebug() << "QSymbianSocketEngine::event"; +#endif switch (ev->type()) { case QEvent::ThreadChange: +#ifdef QNATIVESOCKETENGINE_DEBUG + qDebug() << "ThreadChange"; +#endif if (d->asyncSelect) { delete d->asyncSelect; d->asyncSelect = 0; QEvent *postThreadChangeEvent = new QEvent(PostThreadChangeEvent); QCoreApplication::postEvent(this, postThreadChangeEvent); } + d->selectTimer.Close(); return true; case PostThreadChangeEvent: +#ifdef QNATIVESOCKETENGINE_DEBUG + qDebug() << "PostThreadChangeEvent"; +#endif // recreate select in new thread d->asyncSelect = q_check_ptr(new QAsyncSelect(0, d->nativeSocket, this)); if (d->readNotifier) { |