mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 18:13:29 +02:00
Guard against no script engine thread affinity
This commit is contained in:
parent
1e710712cc
commit
06e827cb5e
1 changed files with 4 additions and 2 deletions
|
@ -154,8 +154,10 @@ ScriptEngine::~ScriptEngine() {
|
|||
|
||||
void ScriptEngine::disconnectNonEssentialSignals() {
|
||||
disconnect();
|
||||
if (_isRunning && _isThreaded) { // ensure the thread is running
|
||||
connect(this, &ScriptEngine::doneRunning, thread(), &QThread::quit);
|
||||
QThread* receiver;
|
||||
// Ensure the thread should be running, and does exist
|
||||
if (_isRunning && _isThreaded && (receiver = thread())) {
|
||||
connect(this, &ScriptEngine::doneRunning, receiver, &QThread::quit);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue