mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-13 23:10:56 -04:00
Don't copy threads in step; stable restartThread (#331)
This commit is contained in:
parent
867c08b495
commit
4deee071b2
2 changed files with 22 additions and 5 deletions
src/engine
|
@ -45,11 +45,9 @@ Sequencer.prototype.stepThreads = function () {
|
|||
this.timer.timeElapsed() < WORK_TIME &&
|
||||
(this.runtime.turboMode || !this.runtime.redrawRequested)) {
|
||||
numActiveThreads = 0;
|
||||
// Inline copy of the threads, updated on each step.
|
||||
var threadsCopy = this.runtime.threads.slice();
|
||||
// Attempt to run each thread one time.
|
||||
for (var i = 0; i < threadsCopy.length; i++) {
|
||||
var activeThread = threadsCopy[i];
|
||||
for (var i = 0; i < this.runtime.threads.length; i++) {
|
||||
var activeThread = this.runtime.threads[i];
|
||||
if (activeThread.stack.length === 0 ||
|
||||
activeThread.status === Thread.STATUS_DONE) {
|
||||
// Finished with this thread.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue