QDaemonThread: replace a function pointer with a lambda

Saves around 0.5KiB in text size on optimized GCC 5.3
Linux AMD 64 builds.

Change-Id: Iaf2664e670a96136031bac67e4012d4f7324eb47
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2015-12-18 14:20:13 +01:00
parent 66e2643072
commit 4262f31330
1 changed files with 2 additions and 6 deletions

View File

@ -883,16 +883,12 @@ bool QThread::isInterruptionRequested() const
Note: don't try to deliver events from the started() signal.
*/
static void setThreadDoesNotRequireCoreApplication()
{
QThreadData::current()->requiresCoreApplication = false;
}
QDaemonThread::QDaemonThread(QObject *parent)
: QThread(parent)
{
// QThread::started() is emitted from the thread we start
connect(this, &QThread::started, setThreadDoesNotRequireCoreApplication);
connect(this, &QThread::started,
[](){ QThreadData::current()->requiresCoreApplication = false; });
}
QDaemonThread::~QDaemonThread()