aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/runextensions.cpp
blob: b69c097957a450d29f4fa99e8f6ddc9c9b1bd303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#include "runextensions.h"

namespace Utils {
namespace Internal {

RunnableThread::RunnableThread(QRunnable *runnable, QObject *parent)
    : QThread(parent),
      m_runnable(runnable)
{
}

void RunnableThread::run()
{
    m_runnable->run();
    if (m_runnable->autoDelete())
        delete m_runnable;
}

} // Internal
} // Utils