mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-30 16:10:08 -04:00
Given the bug found with the old approach, fix this by going and deleting all of the monitor blocks for each sprite and the global variables.
This commit is contained in:
parent
694af40964
commit
3f3c34b43a
3 changed files with 27 additions and 7 deletions
src/engine
|
@ -1541,13 +1541,18 @@ class Runtime extends EventEmitter {
|
|||
return newThreads;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Dispose all targets. Return to clean state.
|
||||
*/
|
||||
dispose () {
|
||||
this.stopAll();
|
||||
// Deleting each target's variable's monitors.
|
||||
this.targets.forEach(target => {
|
||||
if (target.isOriginal) target.deleteMonitors();
|
||||
});
|
||||
|
||||
this.targets.map(this.disposeTarget, this);
|
||||
this.monitorBlocks = new Blocks(true);
|
||||
this._monitorState = OrderedMap({});
|
||||
// @todo clear out extensions? turboMode? etc.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue