Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 2 files). Show all
Unified · Split
| @@ -117,8 +117,6 @@ bool ScriptEngine::_stoppingAllScripts = false; · 116 unmodified lines | |||
| 117 | bool ScriptEngine::_doneRunningThisScript = false; | 117 | bool ScriptEngine::_doneRunningThisScript = false; |
| 118 | 118 | ||
| 119 | void ScriptEngine::stopAllScripts(QObject* application) { | 119 | void ScriptEngine::stopAllScripts(QObject* application) { |
| 120 | qDebug() << "ScriptEngine::stopAllScripts() ------- BEGIN -------"; | ||
| 121 | |||
| 122 | _allScriptsMutex.lock(); | 120 | _allScriptsMutex.lock(); |
| 123 | _stoppingAllScripts = true; | 121 | _stoppingAllScripts = true; |
| 124 | 122 | ||
| @@ -148,14 +146,10 @@ void ScriptEngine::stopAllScripts(QObject* application) { · 23 unmodified lines | |||
| 148 | 146 | ||
| 149 | scriptEngine->waitTillDoneRunning(); | 147 | scriptEngine->waitTillDoneRunning(); |
| 150 | i.remove(); | 148 | i.remove(); |
| 151 | } else { | ||
| 152 | qDebug() << "ScriptEngine::stopAllScripts() " << scriptName << " - will be freed on it's own."; | ||
| 153 | } | 149 | } |
| 154 | } | 150 | } |
| 155 | _stoppingAllScripts = false; | 151 | _stoppingAllScripts = false; |
| 156 | _allScriptsMutex.unlock(); | 152 | _allScriptsMutex.unlock(); |
| 157 | qDebug() << "ScriptEngine::stopAllScripts() _allKnownScriptEngines.count:" << _allKnownScriptEngines.count(); | ||
| 158 | qDebug() << "ScriptEngine::stopAllScripts() ------- DONE -------"; | ||
| 159 | } | 153 | } |
| 160 | 154 | ||
| 161 | 155 | ||
| @@ -693,8 +687,7 @@ QObject* ScriptEngine::setupTimerWithInterval(const QScriptValue& function, int · 531 unmodified lines | |||
| 693 | 687 | ||
| 694 | QObject* ScriptEngine::setInterval(const QScriptValue& function, int intervalMS) { | 688 | QObject* ScriptEngine::setInterval(const QScriptValue& function, int intervalMS) { |
| 695 | if (_stoppingAllScripts) { | 689 | if (_stoppingAllScripts) { |
| 696 | qDebug() << "Script.setInterval() while shutting down is ignored..."; | 690 | qDebug() << "Script.setInterval() while shutting down is ignored... parent script:" << getFilename(); |
| 697 | qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | ||
| 698 | return NULL; // bail early | 691 | return NULL; // bail early |
| 699 | } | 692 | } |
| 700 | 693 | ||
| @@ -703,8 +696,7 @@ QObject* ScriptEngine::setInterval(const QScriptValue& function, int intervalMS) · 2 unmodified lines | |||
| 703 | 696 | ||
| 704 | QObject* ScriptEngine::setTimeout(const QScriptValue& function, int timeoutMS) { | 697 | QObject* ScriptEngine::setTimeout(const QScriptValue& function, int timeoutMS) { |
| 705 | if (_stoppingAllScripts) { | 698 | if (_stoppingAllScripts) { |
| 706 | qDebug() << "Script.setTimeout() while shutting down is ignored..."; | 699 | qDebug() << "Script.setTimeout() while shutting down is ignored... parent script:" << getFilename(); |
| 707 | qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | ||
| 708 | return NULL; // bail early | 700 | return NULL; // bail early |
| 709 | } | 701 | } |
| 710 | 702 | ||
| @@ -754,9 +746,8 @@ void ScriptEngine::print(const QString& message) { · 43 unmodified lines | |||
| 754 | // all of the files have finished loading. | 746 | // all of the files have finished loading. |
| 755 | void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callback) { | 747 | void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callback) { |
| 756 | if (_stoppingAllScripts) { | 748 | if (_stoppingAllScripts) { |
| 757 | qDebug() << "Script.include() while shutting down is ignored..."; | 749 | qDebug() << "Script.include() while shutting down is ignored..." |
| 758 | qDebug() << " includeFiles:" << includeFiles; | 750 | << "includeFiles:" << includeFiles << "parent script:" << getFilename(); |
| 759 | qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | ||
| 760 | return; // bail early | 751 | return; // bail early |
| 761 | } | 752 | } |
| 762 | QList<QUrl> urls; | 753 | QList<QUrl> urls; |
| @@ -799,9 +790,8 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 36 unmodified lines | |||
| 799 | 790 | ||
| 800 | void ScriptEngine::include(const QString& includeFile, QScriptValue callback) { | 791 | void ScriptEngine::include(const QString& includeFile, QScriptValue callback) { |
| 801 | if (_stoppingAllScripts) { | 792 | if (_stoppingAllScripts) { |
| 802 | qDebug() << "Script.include() while shutting down is ignored..."; | 793 | qDebug() << "Script.include() while shutting down is ignored... " |
| 803 | qDebug() << " includeFile:" << includeFile; | 794 | << "includeFile:" << includeFile << "parent script:" << getFilename(); |
| 804 | qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | ||
| 805 | return; // bail early | 795 | return; // bail early |
| 806 | } | 796 | } |
| 807 | 797 | ||
| @@ -815,9 +805,8 @@ void ScriptEngine::include(const QString& includeFile, QScriptValue callback) { · 7 unmodified lines | |||
| 815 | // the Application or other context will connect to in order to know to actually load the script | 805 | // the Application or other context will connect to in order to know to actually load the script |
| 816 | void ScriptEngine::load(const QString& loadFile) { | 806 | void ScriptEngine::load(const QString& loadFile) { |
| 817 | if (_stoppingAllScripts) { | 807 | if (_stoppingAllScripts) { |
| 818 | qDebug() << "Script.load() while shutting down is ignored..."; | 808 | qDebug() << "Script.load() while shutting down is ignored... " |
| 819 | qDebug() << " loadFile:" << loadFile; | 809 | << "loadFile:" << loadFile << "parent script:" << getFilename(); |
| 820 | qDebug() << " parent script:" << getFilename() << "[" << this << "]"; | ||
| 821 | return; // bail early | 810 | return; // bail early |
| 822 | } | 811 | } |
| 823 | 812 | ||