From 722cbfe7384aa5692af4c3f03b562082fadcb93c Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 21 Nov 2011 15:28:57 +0100 Subject: 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 --- src/corelib/kernel/qcoreapplication.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/corelib/kernel/qcoreapplication.cpp') 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; -- cgit v1.2.3