Skip to content

Commit 45cc056

Browse files
committed
fix(cdk/tree): remove leaking subscription (#31457)
Fixes that we weren't unsubscribing from one observable in the tree. Fixes #31454. (cherry picked from commit 69e6600)
1 parent a5d5ed8 commit 45cc056

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cdk/tree/tree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,7 @@ export class CdkTreeNode<T, K = T> implements OnDestroy, OnInit, TreeKeyManagerI
14001400
.changed.pipe(
14011401
map(() => this.isExpanded),
14021402
distinctUntilChanged(),
1403+
takeUntil(this._destroyed),
14031404
)
14041405
.subscribe(() => this._changeDetectorRef.markForCheck());
14051406
this._tree._setNodeTypeIfUnset(this._type);

0 commit comments

Comments
 (0)