Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -118,14 +118,8 @@ ScriptEngine::~ScriptEngine() { · 117 unmodified lines | ||
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | −class MyWorkerThread : public QThread { | |
| 122 | −public: | |
| 123 | − MyWorkerThread(QObject* parent = nullptr) : QThread(parent) { qDebug() << "MyWorkerThread::MyWorkerThread() this:" << this; } | |
| 124 | − ~MyWorkerThread() { qDebug() << "MyWorkerThread::~MyWorkerThread() this:" << this; } | |
| 125 | −}; | |
| 126 | − | |
| 127 | 121 | void ScriptEngine::runInThread() { |
| 128 | − QThread* workerThread = new MyWorkerThread(); // thread is owned but ScriptEngine, so if the ScriptEngine is destroyed, the thread will be too. | |
| 122 | + QThread* workerThread = new QThread(); // thread is owned but ScriptEngine, so if the ScriptEngine is destroyed, the thread will be too. | |
| 129 | 123 | QString scriptEngineName = QString("Script Thread:") + getFilename(); |
| 130 | 124 | workerThread->setObjectName(scriptEngineName); |
| 131 | 125 | |
| @@ -659,12 +653,10 @@ void ScriptEngine::run() { · 527 unmodified lines | ||
| 659 | 653 | _isRunning = false; |
| 660 | 654 | if (_wantSignals) { |
| 661 | 655 | emit runningStateChanged(); |
| 662 | − qDebug() << "ScriptEngine::run().... about to emit doneRunning().... this:" << this << "my thread:" << thread() << "current thread:" << QThread::currentThread(); | |
| 663 | 656 | emit doneRunning(); |
| 664 | 657 | } |
| 665 | 658 | |
| 666 | 659 | _doneRunningThisScript = true; |
| 667 | − qDebug() << "ScriptEngine::run().... END OF RUN.... this:" << this << "my thread:" << thread() << "current thread:" << QThread::currentThread(); | |
| 668 | 660 | } |
| 669 | 661 | |
| 670 | 662 | // NOTE: This is private because it must be called on the same thread that created the timers, which is why |