Fix instances of listeners not being disposed in Query Editor (#5798)

* fix instances of listeners not being disposed

* spelling mistake
This commit is contained in:
Anthony Dresser
2019-05-31 15:14:03 -07:00
committed by GitHub
parent 9f4053d051
commit 33ff8ec5a3
2 changed files with 7 additions and 2 deletions

View File

@@ -251,6 +251,7 @@ export class QueryEditor extends BaseEditor {
if (oldInput) {
this.currentTextEditor.clearInput();
this.resultsEditor.clearInput();
}
// If we're switching editor types switch out the views

View File

@@ -296,18 +296,21 @@ export class QueryResultsView extends Disposable {
if (info) {
this.setQueryRunner(info.queryRunner);
} else {
let disposeable = this.queryModelService.onRunQueryStart(c => {
let disposable = this.queryModelService.onRunQueryStart(c => {
if (c === input.uri) {
let info = this.queryModelService._getQueryInfo(input.uri);
this.setQueryRunner(info.queryRunner);
disposeable.dispose();
disposable.dispose();
}
});
this.runnerDisposables.push(disposable);
}
}
clearInput() {
this._input = undefined;
dispose(this.runnerDisposables);
this.runnerDisposables = [];
this.resultsTab.clear();
this.messagesTab.clear();
this.qpTab.clear();
@@ -389,6 +392,7 @@ export class QueryResultsView extends Disposable {
public dispose() {
dispose(this.runnerDisposables);
this.runnerDisposables = [];
super.dispose();
}