History

Merge remote-tracking branch 'upstream/master' into kasenvr-kpi-v1-modkit-rc-merge

humbletim committed 7 years ago

Commit 271fac42 parents bad32e9 96f67931529 files · +58136 −6493Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1529 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+12−5
@@ -427,6 +427,12 @@ void ScriptEngine::waitTillDoneRunning() { · 426 unmodified lines
427427 if (isEvaluating()) {
428428 qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
429429 abortEvaluation();
430+ } else {
431+ auto context = currentContext();
432+ if (context) {
433+ qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
434+ context->throwError("Timed out during shutdown");
435+ }
430436 }
431437
432438 // Wait for the scripting thread to stop running, as
@@ -449,9 +455,9 @@ void ScriptEngine::waitTillDoneRunning() { · 16 unmodified lines
449455 qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
450456 abortEvaluation();
451457 } else {
452− qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
453458 auto context = currentContext();
454459 if (context) {
460+ qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
455461 context->throwError("Timed out during shutdown");
456462 }
457463 }
@@ -2209,7 +2215,7 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString& · 1751 unmodified lines
22092215 /**jsdoc
22102216 * Triggered when the script starts for a user. See also, {@link Script.entityScriptPreloadFinished}.
22112217 * <p>Note: Can only be connected to via <code>this.preload = function (...) { ... }</code> in the entity script.</p>
2212− * <table><tr><th>Available in:</th><td>Client Entity Scripts</td><td>Server Entity Scripts</td></tr></table>
2218+ * <p class="availableIn"><strong>Supported Script Types:</strong> Client Entity Scripts &bull; Server Entity Scripts</p>
22132219 * @function Entities.preload
22142220 * @param {Uuid} entityID - The ID of the entity that the script is running in.
22152221 * @returns {Signal}
@@ -2415,7 +2421,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 199 unmodified lines
24152421 /**jsdoc
24162422 * Triggered when the script terminates for a user.
24172423 * <p>Note: Can only be connected to via <code>this.unoad = function () { ... }</code> in the entity script.</p>
2418− * <table><tr><th>Available in:</th><td>Client Entity Scripts</td><td>Server Entity Scripts</td></tr></table>
2424+ * <p class="availableIn"><strong>Supported Script Types:</strong> Client Entity Scripts &bull; Server Entity Scripts</p>
24192425 * @function Entities.unload
24202426 * @param {Uuid} entityID - The ID of the entity that the script is running in.
24212427 * @returns {Signal}
@@ -2475,13 +2481,14 @@ QList<EntityItemID> ScriptEngine::getListOfEntityScriptIDs() { · 53 unmodified lines
24752481 return _entityScripts.keys();
24762482 }
24772483
2478−void ScriptEngine::unloadAllEntityScripts() {
2484+void ScriptEngine::unloadAllEntityScripts(bool blockingCall) {
24792485 if (QThread::currentThread() != thread()) {
24802486 #ifdef THREAD_DEBUGGING
24812487 qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
24822488 #endif
24832489
2484− QMetaObject::invokeMethod(this, "unloadAllEntityScripts");
2490+ QMetaObject::invokeMethod(this, "unloadAllEntityScripts",
2491+ blockingCall ? Qt::BlockingQueuedConnection : Qt::QueuedConnection);
24852492 return;
24862493 }
24872494 #ifdef THREAD_DEBUGGING

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t