// 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;
bool isAdopted;
};
+class QScopedLoopLevelCounter
+{
+ QThreadData *threadData;
+public:
+ inline QScopedLoopLevelCounter(QThreadData *threadData)
+ : threadData(threadData)
+ { ++threadData->loopLevel; }
+ inline ~QScopedLoopLevelCounter()
+ { --threadData->loopLevel; }
+};
+
// thread wrapper for the main() thread
class QAdoptedThread : public QThread
{
#include "QtCore/qhash.h"
#include "QtCore/qpointer.h"
#include "private/qcoreapplication_p.h"
-#include <private/qthread_p.h>
#include "QtCore/qpoint.h"
#include <QTime>
#include <QWindowSystemInterface>
#endif // Q_WS_WIN
-class QScopedLoopLevelCounter
-{
- QThreadData *threadData;
-public:
- QScopedLoopLevelCounter(QThreadData *threadData)
- : threadData(threadData)
- { ++threadData->loopLevel; }
- ~QScopedLoopLevelCounter()
- { --threadData->loopLevel; }
-};
-
struct FontHash : public QHash<QByteArray, QFont>
{
FontHash();