Fix issue when broadcasting in a when-broadcast

This commit is contained in:
Tim Mickel 2016-08-23 18:37:03 -04:00
parent fe2ba2a536
commit 4f2cccf279
2 changed files with 2 additions and 2 deletions

View file

@ -76,7 +76,8 @@ Scratch3EventBlocks.prototype.broadcastAndWait = function (args, util) {
var waiting = false;
for (var i = 0; i < util.stackFrame.triggeredThreads.length; i++) {
var thread = util.stackFrame.triggeredThreads[i];
if (thread.status !== Thread.STATUS_DONE) {
var activeThreads = this.runtime.threads;
if (activeThreads.indexOf(thread) > -1) { // @todo: A cleaner way?
waiting = true;
}
}

View file

@ -204,7 +204,6 @@ Runtime.prototype._pushThread = function (id) {
* @param {?Thread} thread Thread object to remove from actives
*/
Runtime.prototype._removeThread = function (thread) {
thread.setStatus(Thread.STATUS_DONE);
var i = this.threads.indexOf(thread);
if (i > -1) {
this.glowScript(thread.topBlock, false);