summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-11-21 15:28:57 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-24 15:06:31 +0100
commit722cbfe7384aa5692af4c3f03b562082fadcb93c (patch)
tree3e0c75c4a7a81d73faf7b88103ec7b3769f1254a /src/corelib/kernel/qcoreapplication.cpp
parent90b67743d1bdcb6d98e7d10d2b304b500285ec58 (diff)
Move QScopedLoopLevelCounter to qthread_p.h
... and use it in QCoreApplication::notifyInterna() instead of "reinventing" the wheel there. The constructor and destructor for QScopedLoopLevelCounter are inline, so the class does not need to be exported. Change-Id: I7af5a4ef0987f277bcc50c1057f3c74152f3d79d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index c30f6135a9..2a80d39620 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -809,16 +809,7 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
// call overhead.
QObjectPrivate *d = receiver->d_func();
QThreadData *threadData = d->threadData;
-
- // Exception-safety without try/catch
- struct Incrementer {
- int &variable;
- inline Incrementer(int &variable) : variable(variable)
- { ++variable; }
- inline ~Incrementer()
- { --variable; }
- };
- Incrementer inc(threadData->loopLevel);
+ QScopedLoopLevelCounter loopLevelCounter(threadData);
#ifdef QT_JAMBI_BUILD
int deleteWatch = 0;