Merge pull request from picklesrus/monitor-vars-project-load

Clear out the blocks in dispose. Fixes  where old monitored vari…
This commit is contained in:
picklesrus 2018-12-07 15:08:09 -05:00 committed by GitHub
commit ebe06a97d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 71 additions and 42 deletions
src/engine

View file

@ -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);