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:
picklesrus 2018-12-06 18:59:58 -05:00
parent 694af40964
commit 3f3c34b43a
3 changed files with 27 additions and 7 deletions
src/engine

View file

@ -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.