Avoid memory leak where the _markersData never has its elements removed

上级 b7381d34
......@@ -38,7 +38,9 @@ class MarkerDecorations extends Disposable {
}
public update(markers: IMarker[], newDecorations: IModelDeltaDecoration[]): void {
const ids = this.model.deltaDecorations(keys(this._markersData), newDecorations);
const oldIds = keys(this._markersData);
this._markersData.clear();
const ids = this.model.deltaDecorations(oldIds, newDecorations);
for (let index = 0; index < ids.length; index++) {
this._markersData.set(ids[index], markers[index]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册