mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user