mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Merge pull request #7427 from huffman/fix-scriptengine-threading
Add protection around ScriptEngine::runInThread being called twice
This commit is contained in:
commit
2e6c360708
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