mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-01 17:11:21 -04:00
Merge pull request #1818 from picklesrus/monitor-vars-project-load
Clear out the blocks in dispose. Fixes #1758 where old monitored vari…
This commit is contained in:
commit
ebe06a97d9
7 changed files with 71 additions and 42 deletions
src/engine
|
@ -1549,11 +1549,17 @@ 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._monitorState = OrderedMap({});
|
||||
this.emit(Runtime.RUNTIME_DISPOSED);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue