Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -42,12 +42,6 @@ · 41 unmodified lines | ||
| 42 | 42 | #include "MIDIEvent.h" |
| 43 | 43 | |
| 44 | 44 | |
| 45 | −#ifdef WANT_DEBUG_SCRIPT_ENDING | |
| 46 | −#define DEBUG_SCRIPT_ENDING(X) X | |
| 47 | −#else | |
| 48 | −#define DEBUG_SCRIPT_ENDING(x) | |
| 49 | −#endif | |
| 50 | − | |
| 51 | 45 | EntityScriptingInterface ScriptEngine::_entityScriptingInterface; |
| 52 | 46 | |
| 53 | 47 | static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine){ |
| @@ -107,7 +101,6 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam · 53 unmodified lines | ||
| 107 | 101 | } |
| 108 | 102 | |
| 109 | 103 | ScriptEngine::~ScriptEngine() { |
| 110 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::~ScriptEngine() ------- BEGIN ------- script:" << getFilename();) | |
| 111 | 104 | // If we're not already in the middle of stopping all scripts, then we should remove ourselves |
| 112 | 105 | // from the list of running scripts. We don't do this if we're in the process of stopping all scripts |
| 113 | 106 | // because that method removes scripts from its list as it iterates them |
| @@ -116,7 +109,6 @@ ScriptEngine::~ScriptEngine() { · 2 unmodified lines | ||
| 116 | 109 | _allKnownScriptEngines.remove(this); |
| 117 | 110 | _allScriptsMutex.unlock(); |
| 118 | 111 | } |
| 119 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::~ScriptEngine() ------- END ------- script:" << getFilename();) | |
| 120 | 112 | } |
| 121 | 113 | |
| 122 | 114 | QSet<ScriptEngine*> ScriptEngine::_allKnownScriptEngines; |
| @@ -136,8 +128,6 @@ void ScriptEngine::stopAllScripts(QObject* application) { · 13 unmodified lines | ||
| 136 | 128 | |
| 137 | 129 | QString scriptName = scriptEngine->getFilename(); |
| 138 | 130 | |
| 139 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() considering:" << scriptName << "isRunning():" << scriptEngine->isRunning() << "evaluatePending():" << scriptEngine->evaluatePending();) | |
| 140 | − | |
| 141 | 131 | // NOTE: typically all script engines are running. But there's at least one known exception to this, the |
| 142 | 132 | // "entities sandbox" which is only used to evaluate entities scripts to test their validity before using |
| 143 | 133 | // them. We don't need to stop scripts that aren't running. |
| @@ -149,18 +139,14 @@ void ScriptEngine::stopAllScripts(QObject* application) { · 5 unmodified lines | ||
| 149 | 139 | while (scriptEngine->evaluatePending()) { |
| 150 | 140 | QEventLoop loop; |
| 151 | 141 | QObject::connect(scriptEngine, &ScriptEngine::evaluationFinished, &loop, &QEventLoop::quit); |
| 152 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() while(evaluatePending()) STARTING loop.exec() script:" << scriptName;) | |
| 153 | 142 | loop.exec(); |
| 154 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() while(evaluatePending()) AFTER loop.exec() script:" << scriptName;) | |
| 155 | 143 | } |
| 156 | 144 | } |
| 157 | 145 | |
| 158 | 146 | scriptEngine->disconnect(application); |
| 159 | 147 | scriptEngine->stop(); |
| 160 | 148 | |
| 161 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() -- WAITING for waitTillDoneRunning() script:" << scriptName;) | |
| 162 | 149 | scriptEngine->waitTillDoneRunning(); |
| 163 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stopAllScripts() -- AFTER waitTillDoneRunning() script:" << scriptName;) | |
| 164 | 150 | i.remove(); |
| 165 | 151 | } else { |
| 166 | 152 | qDebug() << "ScriptEngine::stopAllScripts() " << scriptName << " - will be freed on it's own."; |
| @@ -175,10 +161,8 @@ void ScriptEngine::stopAllScripts(QObject* application) { · 8 unmodified lines | ||
| 175 | 161 | |
| 176 | 162 | void ScriptEngine::waitTillDoneRunning() { |
| 177 | 163 | QString scriptName = getFilename(); |
| 178 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() ------- BEGIN ------- script:" << scriptName;) | |
| 179 | 164 | |
| 180 | 165 | if (_isRunning) { |
| 181 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() SETTING _doneRunningThisScript = false ################################### line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 182 | 166 | _doneRunningThisScript = false; |
| 183 | 167 | _isWaitingForDoneRunning = true; |
| 184 | 168 | |
| @@ -191,31 +175,18 @@ void ScriptEngine::waitTillDoneRunning() { · 6 unmodified lines | ||
| 191 | 175 | // and run a QEventLoop??? |
| 192 | 176 | QEventLoop loop; |
| 193 | 177 | QObject::connect(this, &ScriptEngine::doneRunning, &loop, &QEventLoop::quit); |
| 194 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() STARTING loop.exec() script:" << scriptName;) | |
| 195 | − DEBUG_SCRIPT_ENDING(qDebug() << " _doneRunningThisScript:" << _doneRunningThisScript;) | |
| 196 | − DEBUG_SCRIPT_ENDING(qDebug() << " _isRunning:" << _isRunning;) | |
| 197 | − DEBUG_SCRIPT_ENDING(qDebug() << " _isWaitingForDoneRunning:" << _isWaitingForDoneRunning;) | |
| 198 | − DEBUG_SCRIPT_ENDING(qDebug() << " _isFinished:" << _isFinished;) | |
| 199 | − DEBUG_SCRIPT_ENDING(qDebug() << " _isInitialized:" << _isInitialized;) | |
| 200 | − DEBUG_SCRIPT_ENDING(qDebug() << " _evaluatesPending:" << _evaluatesPending;) | |
| 201 | 178 | loop.exec(); |
| 202 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() AFTER loop.exec() script:" << scriptName;) | |
| 203 | 179 | |
| 204 | 180 | // process events |
| 205 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() STARTING QCoreApplication::processEvents() script:" << scriptName;) | |
| 206 | 181 | QCoreApplication::processEvents(); |
| 207 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() AFTER QCoreApplication::processEvents() script:" << scriptName;) | |
| 208 | 182 | |
| 209 | 183 | if (_doneRunningThisScript) { |
| 210 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() _doneRunningThisScript after processEvents... breaking!!! script:" << scriptName;) | |
| 211 | 184 | break; |
| 212 | 185 | } |
| 213 | 186 | } |
| 214 | 187 | |
| 215 | 188 | _isWaitingForDoneRunning = false; |
| 216 | 189 | } |
| 217 | − | |
| 218 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::waitTillDoneRunning() ------- DONE ------- script:" << scriptName;) | |
| 219 | 190 | } |
| 220 | 191 | |
| 221 | 192 | QString ScriptEngine::getFilename() const { |
| @@ -428,25 +399,20 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 206 unmodified lines | ||
| 428 | 399 | |
| 429 | 400 | void ScriptEngine::evaluate() { |
| 430 | 401 | if (_stoppingAllScripts) { |
| 431 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate() while shutting down is ignored...";) | |
| 432 | − DEBUG_SCRIPT_ENDING(qDebug() << " parent script:" << getFilename() << "[" << this << "]";) | |
| 433 | 402 | return; // bail early |
| 434 | 403 | } |
| 435 | 404 | |
| 436 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate() -- BEGIN script:" << getFilename() << "[" << this << "]";) | |
| 437 | 405 | if (!_isInitialized) { |
| 438 | 406 | init(); |
| 439 | 407 | } |
| 440 | 408 | |
| 441 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate() -- about to call own evaluate(program) script:" << getFilename() << "[" << this << "]";) | |
| 442 | 409 | QScriptValue result = evaluate(_scriptContents); |
| 443 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate() -- AFTER own evaluate(program) script:" << getFilename() << "[" << this << "]";) | |
| 444 | 410 | |
| 445 | 411 | // TODO: why do we check this twice? It seems like the call to clearExcpetions() in the lower level evaluate call |
| 446 | 412 | // will cause this code to never actually run... |
| 447 | 413 | if (hasUncaughtException()) { |
| 448 | 414 | int line = uncaughtExceptionLineNumber(); |
| 449 | − DEBUG_SCRIPT_ENDING(qDebug() << "Uncaught exception at (" << _fileNameString << ") line" << line << ":" << result.toString();) | |
| 415 | + qDebug() << "Uncaught exception at (" << _fileNameString << ") line" << line << ":" << result.toString(); | |
| 450 | 416 | emit errorMessage("Uncaught exception at (" + _fileNameString + ") line" + QString::number(line) + ":" + result.toString()); |
| 451 | 417 | clearExceptions(); |
| 452 | 418 | } |
| @@ -454,29 +420,18 @@ void ScriptEngine::evaluate() { · 1 unmodified line | ||
| 454 | 420 | |
| 455 | 421 | QScriptValue ScriptEngine::evaluate(const QString& program, const QString& fileName, int lineNumber) { |
| 456 | 422 | if (_stoppingAllScripts) { |
| 457 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) while shutting down is ignored...";) | |
| 458 | − DEBUG_SCRIPT_ENDING(qDebug() << " parent script:" << getFilename() << "[" << this << "]";) | |
| 459 | 423 | return QScriptValue(); // bail early |
| 460 | 424 | } |
| 461 | 425 | |
| 462 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- BEGIN script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 463 | 426 | _evaluatesPending++; |
| 464 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- after _evaluatesPending++ script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 465 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- BEFORE QScriptEngine::evaluate() script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 466 | 427 | QScriptValue result = QScriptEngine::evaluate(program, fileName, lineNumber); |
| 467 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- AFTER QScriptEngine::evaluate() script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 468 | 428 | if (hasUncaughtException()) { |
| 469 | 429 | int line = uncaughtExceptionLineNumber(); |
| 470 | 430 | qDebug() << "Uncaught exception at (" << _fileNameString << " : " << fileName << ") line" << line << ": " << result.toString(); |
| 471 | 431 | } |
| 472 | 432 | _evaluatesPending--; |
| 473 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- after _evaluatesPending-- script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 474 | − | |
| 475 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- ABOUT TO emit evaluationFinished() script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 476 | 433 | emit evaluationFinished(result, hasUncaughtException()); |
| 477 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- AFTER emit evaluationFinished() script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 478 | 434 | clearExceptions(); |
| 479 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::evaluate(program) -- DONE script:" << getFilename() << "_evaluatesPending:" << _evaluatesPending << "[" << this << "]";) | |
| 480 | 435 | return result; |
| 481 | 436 | } |
| 482 | 437 | |
| @@ -496,18 +451,14 @@ void ScriptEngine::run() { · 13 unmodified lines | ||
| 496 | 451 | // TODO: can we add a short circuit for _stoppingAllScripts here? What does it mean to not start running if |
| 497 | 452 | // we're in the process of stopping? |
| 498 | 453 | |
| 499 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 500 | 454 | if (!_isInitialized) { |
| 501 | 455 | init(); |
| 502 | 456 | } |
| 503 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 504 | 457 | _isRunning = true; |
| 505 | 458 | _isFinished = false; |
| 506 | 459 | emit runningStateChanged(); |
| 507 | 460 | |
| 508 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 509 | 461 | QScriptValue result = evaluate(_scriptContents); |
| 510 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 511 | 462 | |
| 512 | 463 | QElapsedTimer startTime; |
| 513 | 464 | startTime.start(); |
| @@ -518,35 +469,19 @@ void ScriptEngine::run() { · 4 unmodified lines | ||
| 518 | 469 | |
| 519 | 470 | qint64 lastUpdate = usecTimestampNow(); |
| 520 | 471 | |
| 521 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 522 | − | |
| 523 | 472 | while (!_isFinished) { |
| 524 | − if (_isWaitingForDoneRunning) { | |
| 525 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 526 | − } | |
| 527 | − | |
| 528 | 473 | int usecToSleep = (thisFrame++ * SCRIPT_DATA_CALLBACK_USECS) - startTime.nsecsElapsed() / 1000; // nsec to usec |
| 529 | 474 | if (usecToSleep > 0) { |
| 530 | 475 | usleep(usecToSleep); |
| 531 | 476 | } |
| 532 | 477 | |
| 533 | 478 | if (_isFinished) { |
| 534 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 535 | 479 | break; |
| 536 | 480 | } |
| 537 | 481 | |
| 538 | − if (_isWaitingForDoneRunning) { | |
| 539 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 540 | − } | |
| 541 | − | |
| 542 | 482 | QCoreApplication::processEvents(); |
| 543 | 483 | |
| 544 | − if (_isWaitingForDoneRunning) { | |
| 545 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 546 | − } | |
| 547 | − | |
| 548 | 484 | if (_isFinished) { |
| 549 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 550 | 485 | break; |
| 551 | 486 | } |
| 552 | 487 | |
| @@ -675,37 +610,14 @@ void ScriptEngine::run() { · 122 unmodified lines | ||
| 675 | 610 | } |
| 676 | 611 | lastUpdate = now; |
| 677 | 612 | |
| 678 | − if (_isWaitingForDoneRunning) { | |
| 679 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 680 | − } | |
| 681 | − | |
| 682 | − } | |
| 683 | − | |
| 684 | − if (_isWaitingForDoneRunning) { | |
| 685 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 686 | 613 | } |
| 687 | 614 | |
| 688 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 689 | − | |
| 690 | 615 | stopAllTimers(); // make sure all our timers are stopped if the script is ending |
| 691 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename();) | |
| 692 | − | |
| 693 | − if (_isWaitingForDoneRunning) { | |
| 694 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 695 | − } | |
| 696 | − | |
| 697 | 616 | emit scriptEnding(); |
| 698 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 699 | 617 | |
| 700 | 618 | // kill the avatar identity timer |
| 701 | 619 | delete _avatarIdentityTimer; |
| 702 | 620 | |
| 703 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 704 | − | |
| 705 | − if (_isWaitingForDoneRunning) { | |
| 706 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 707 | − } | |
| 708 | − | |
| 709 | 621 | if (_entityScriptingInterface.getEntityPacketSender()->serversExist()) { |
| 710 | 622 | // release the queue of edit entity messages. |
| 711 | 623 | _entityScriptingInterface.getEntityPacketSender()->releaseQueuedMessages(); |
| @@ -716,44 +628,19 @@ void ScriptEngine::run() { · 4 unmodified lines | ||
| 716 | 628 | } |
| 717 | 629 | } |
| 718 | 630 | |
| 719 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 720 | − | |
| 721 | 631 | // If we were on a thread, then wait till it's done |
| 722 | 632 | if (thread()) { |
| 723 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 724 | 633 | thread()->quit(); |
| 725 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 726 | − } | |
| 727 | − | |
| 728 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 729 | − | |
| 730 | − if (_isWaitingForDoneRunning) { | |
| 731 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 732 | 634 | } |
| 733 | 635 | |
| 734 | 636 | emit finished(_fileNameString); |
| 735 | 637 | |
| 736 | − if (_isWaitingForDoneRunning) { | |
| 737 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 738 | − } | |
| 739 | − | |
| 740 | 638 | _isRunning = false; |
| 741 | 639 | emit runningStateChanged(); |
| 742 | 640 | |
| 743 | − DEBUG_SCRIPT_ENDING(qDebug() << "ABOUT TO emit doneRunning() script:" << getFilename() << "[" << this << "]";) | |
| 744 | 641 | emit doneRunning(); |
| 745 | − DEBUG_SCRIPT_ENDING(qDebug() << "AFTER emit doneRunning() script:" << getFilename() << "[" << this << "]";) | |
| 746 | 642 | |
| 747 | − if (_isWaitingForDoneRunning) { | |
| 748 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 749 | − } | |
| 750 | − | |
| 751 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() SETTING _doneRunningThisScript = true ################################### line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 752 | 643 | _doneRunningThisScript = true; |
| 753 | − | |
| 754 | − if (_isWaitingForDoneRunning) { | |
| 755 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::run() ** _isWaitingForDoneRunning == true ** line:" << __LINE__ << " script:" << getFilename() << "[" << this << "]";) | |
| 756 | − } | |
| 757 | 644 | } |
| 758 | 645 | |
| 759 | 646 | // NOTE: This is private because it must be called on the same thread that created the timers, which is why |
| @@ -768,10 +655,8 @@ void ScriptEngine::stopAllTimers() { · 8 unmodified lines | ||
| 768 | 655 | } |
| 769 | 656 | |
| 770 | 657 | void ScriptEngine::stop() { |
| 771 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stop() -- START -- line:" << __LINE__ << " script:" << getFilename();) | |
| 772 | 658 | _isFinished = true; |
| 773 | 659 | emit runningStateChanged(); |
| 774 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::stop() -- DONE -- line:" << __LINE__ << " script:" << getFilename();) | |
| 775 | 660 | } |
| 776 | 661 | |
| 777 | 662 | void ScriptEngine::timerFired() { |
| @@ -887,9 +772,7 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 109 unmodified lines | ||
| 887 | 772 | if (contents.isNull()) { |
| 888 | 773 | qDebug() << "Error loading file: " << url; |
| 889 | 774 | } else { |
| 890 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::include() BEFORE evaluate() line:" << __LINE__ << " parent script:" << getFilename() << "[" << this << "]" << " url:" << url << "_evaluatesPending:" << _evaluatesPending;) | |
| 891 | 775 | QScriptValue result = evaluate(contents, url.toString()); |
| 892 | − DEBUG_SCRIPT_ENDING(qDebug() << "ScriptEngine::include() AFTER evaluate() line:" << __LINE__ << " parent script:" << getFilename() << "[" << this << "]" << " url:" << url << "_evaluatesPending:" << _evaluatesPending;) | |
| 893 | 776 | } |
| 894 | 777 | } |
| 895 | 778 | |