mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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) {
|
if (oldInput) {
|
||||||
this.currentTextEditor.clearInput();
|
this.currentTextEditor.clearInput();
|
||||||
|
this.resultsEditor.clearInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're switching editor types switch out the views
|
// If we're switching editor types switch out the views
|
||||||
|
|||||||
@@ -296,18 +296,21 @@ export class QueryResultsView extends Disposable {
|
|||||||
if (info) {
|
if (info) {
|
||||||
this.setQueryRunner(info.queryRunner);
|
this.setQueryRunner(info.queryRunner);
|
||||||
} else {
|
} else {
|
||||||
let disposeable = this.queryModelService.onRunQueryStart(c => {
|
let disposable = this.queryModelService.onRunQueryStart(c => {
|
||||||
if (c === input.uri) {
|
if (c === input.uri) {
|
||||||
let info = this.queryModelService._getQueryInfo(input.uri);
|
let info = this.queryModelService._getQueryInfo(input.uri);
|
||||||
this.setQueryRunner(info.queryRunner);
|
this.setQueryRunner(info.queryRunner);
|
||||||
disposeable.dispose();
|
disposable.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.runnerDisposables.push(disposable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clearInput() {
|
clearInput() {
|
||||||
this._input = undefined;
|
this._input = undefined;
|
||||||
|
dispose(this.runnerDisposables);
|
||||||
|
this.runnerDisposables = [];
|
||||||
this.resultsTab.clear();
|
this.resultsTab.clear();
|
||||||
this.messagesTab.clear();
|
this.messagesTab.clear();
|
||||||
this.qpTab.clear();
|
this.qpTab.clear();
|
||||||
@@ -389,6 +392,7 @@ export class QueryResultsView extends Disposable {
|
|||||||
|
|
||||||
public dispose() {
|
public dispose() {
|
||||||
dispose(this.runnerDisposables);
|
dispose(this.runnerDisposables);
|
||||||
|
this.runnerDisposables = [];
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user