Skip to content

Commit f749d68

Browse files
committed
Fix disposable tracking for DisposableMap
Fixes microsoft#258878
1 parent 709aafe commit f749d68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vs/base/common/lifecycle.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ export class DisposableMap<K, V extends IDisposable = IDisposable> implements ID
795795
}
796796

797797
this._store.set(key, value);
798+
setParentOfDisposable(value, this);
798799
}
799800

800801
/**
@@ -811,6 +812,9 @@ export class DisposableMap<K, V extends IDisposable = IDisposable> implements ID
811812
*/
812813
deleteAndLeak(key: K): V | undefined {
813814
const value = this._store.get(key);
815+
if (value) {
816+
setParentOfDisposable(value, null);
817+
}
814818
this._store.delete(key);
815819
return value;
816820
}

0 commit comments

Comments
 (0)