mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Add protection around ScriptEngine::runInThread being called twice
This commit is contained in:
parent
6b3a4eb327
commit
1a2f74f43a
1 changed files with 7 additions and 0 deletions
|
@ -158,6 +158,13 @@ void ScriptEngine::disconnectNonEssentialSignals() {
|
|||
}
|
||||
|
||||
void ScriptEngine::runInThread() {
|
||||
Q_ASSERT_X(!_isThreaded, "ScriptEngine::runInThread()", "runInThread should not be called more than once");
|
||||
|
||||
if (_isThreaded) {
|
||||
qCWarning(scriptengine) << "ScriptEngine already running in thread: " << getFilename();
|
||||
return;
|
||||
}
|
||||
|
||||
_isThreaded = true;
|
||||
QThread* workerThread = new QThread(); // thread is not owned, so we need to manage the delete
|
||||
QString scriptEngineName = QString("Script Thread:") + getFilename();
|
||||
|
|
Loading…
Reference in a new issue