Fix decoration lifecycle issues
This commit is contained in:
@@ -32,7 +32,10 @@ export class DecorationService extends Disposable implements IDecorationService
|
|||||||
if (decoration) {
|
if (decoration) {
|
||||||
decoration.onDispose(() => {
|
decoration.onDispose(() => {
|
||||||
if (decoration) {
|
if (decoration) {
|
||||||
this._decorations.splice(this._decorations.indexOf(decoration), 1);
|
const index = this._decorations.indexOf(decoration);
|
||||||
|
if (index >= 0) {
|
||||||
|
this._decorations.splice(this._decorations.indexOf(decoration), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this._decorations.push(decoration);
|
this._decorations.push(decoration);
|
||||||
@@ -70,6 +73,10 @@ class Decoration extends Disposable implements IInternalDecoration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override dispose(): void {
|
public override dispose(): void {
|
||||||
|
if (this._isDisposed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._isDisposed = true;
|
||||||
this._onDispose.fire();
|
this._onDispose.fire();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user