Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -125,7 +125,7 @@ bool ScriptEngine::_stoppingAllScripts = false; · 124 unmodified lines | ||
| 125 | 125 | bool ScriptEngine::_doneRunningThisScript = false; |
| 126 | 126 | |
| 127 | 127 | void ScriptEngine::stopAllScripts(QObject* application) { |
| 128 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() ------- BEGIN -------";) | |
| 128 | + qDebug() << "ScriptEngine::stopAllScripts() ------- BEGIN -------"; | |
| 129 | 129 | |
| 130 | 130 | _allScriptsMutex.lock(); |
| 131 | 131 | _stoppingAllScripts = true; |
| @@ -136,9 +136,7 @@ void ScriptEngine::stopAllScripts(QObject* application) { · 4 unmodified lines | ||
| 136 | 136 | |
| 137 | 137 | QString scriptName = scriptEngine->getFilename(); |
| 138 | 138 | |
| 139 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() considering:" << scriptName | |
| 140 | − << "isRunning():" << scriptEngine->isRunning() | |
| 141 | − << "evaluatePending():" << scriptEngine->evaluatePending();) | |
| 139 | + DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() considering:" << scriptName << "isRunning():" << scriptEngine->isRunning() << "evaluatePending():" << scriptEngine->evaluatePending();) | |
| 142 | 140 | |
| 143 | 141 | // NOTE: typically all script engines are running. But there's at least one known exception to this, the |
| 144 | 142 | // "entities sandbox" which is only used to evaluate entities scripts to test their validity before using |
| @@ -165,11 +163,13 @@ void ScriptEngine::stopAllScripts(QObject* application) { · 20 unmodified lines | ||
| 165 | 163 | DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() -- AFTER waitTillDoneRunning() script:" << scriptName;) |
| 166 | 164 | i.remove(); |
| 167 | 165 | } else { |
| 166 | + qDebug() << "ScriptEngine::stopAllScripts() " << scriptName << " - will be freed on it's own."; | |
| 168 | 167 | } |
| 169 | 168 | } |
| 170 | 169 | _stoppingAllScripts = false; |
| 171 | 170 | _allScriptsMutex.unlock(); |
| 172 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() ------- DONE -------";) | |
| 171 | + qDebug() << "ScriptEngine::stopAllScripts() _allKnownScriptEngines.count:" << _allKnownScriptEngines.count(); | |
| 172 | + qDebug() << "ScriptEngine::stopAllScripts() ------- DONE -------"; | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| @@ -428,8 +428,8 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 252 unmodified lines | ||
| 428 | 428 | |
| 429 | 429 | void ScriptEngine::evaluate() { |
| 430 | 430 | if (_stoppingAllScripts) { |
| 431 | − qDebug() << "ScriptEngine::evaluate() while shutting down is ignored..."; | |
| 432 | − qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | |
| 431 | + DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate() while shutting down is ignored...";) | |
| 432 | + DEBUG_SCRIPT_ENDING(qDebug() << " parent script:" << getFilename() << "[" << this << "]";) | |
| 433 | 433 | return; // bail early |
| 434 | 434 | } |
| 435 | 435 | |
| @@ -454,8 +454,8 @@ void ScriptEngine::evaluate() { · 18 unmodified lines | ||
| 454 | 454 | |
| 455 | 455 | QScriptValue ScriptEngine::evaluate(const QString& program, const QString& fileName, int lineNumber) { |
| 456 | 456 | if (_stoppingAllScripts) { |
| 457 | − qDebug() << "ScriptEngine::evaluate(program) while shutting down is ignored..."; | |
| 458 | − qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | |
| 457 | + DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) while shutting down is ignored...";) | |
| 458 | + DEBUG_SCRIPT_ENDING(qDebug() << " parent script:" << getFilename() << "[" << this << "]";) | |
| 459 | 459 | return QScriptValue(); // bail early |
| 460 | 460 | } |
| 461 | 461 | |