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 | void ScriptEngine::runInThread() { | 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 | QString scriptEngineName = QString("Script Thread:") + getFilename(); | 123 | QString scriptEngineName = QString("Script Thread:") + getFilename(); |
| 130 | workerThread->setObjectName(scriptEngineName); | 124 | workerThread->setObjectName(scriptEngineName); |
| 131 | 125 | ||
| @@ -659,12 +653,10 @@ void ScriptEngine::run() { · 527 unmodified lines | |||
| 659 | _isRunning = false; | 653 | _isRunning = false; |
| 660 | if (_wantSignals) { | 654 | if (_wantSignals) { |
| 661 | emit runningStateChanged(); | 655 | emit runningStateChanged(); |
| 662 | qDebug() << "ScriptEngine::run().... about to emit doneRunning().... this:" << this << "my thread:" << thread() << "current thread:" << QThread::currentThread(); | ||
| 663 | emit doneRunning(); | 656 | emit doneRunning(); |
| 664 | } | 657 | } |
| 665 | 658 | ||
| 666 | _doneRunningThisScript = true; | 659 | _doneRunningThisScript = true; |
| 667 | qDebug() << "ScriptEngine::run().... END OF RUN.... this:" << this << "my thread:" << thread() << "current thread:" << QThread::currentThread(); | ||
| 668 | } | 660 | } |
| 669 | 661 | ||
| 670 | // NOTE: This is private because it must be called on the same thread that created the timers, which is why | 662 | // NOTE: This is private because it must be called on the same thread that created the timers, which is why |