()
| 1405 | } |
| 1406 | |
| 1407 | ngOnDestroy() { |
| 1408 | // If this is the last tree node being destroyed, |
| 1409 | // clear out the reference to avoid leaking memory. |
| 1410 | if (CdkTreeNode.mostRecentTreeNode === this) { |
| 1411 | CdkTreeNode.mostRecentTreeNode = null; |
| 1412 | } |
| 1413 | |
| 1414 | this._dataChanges.complete(); |
| 1415 | this._destroyed.next(); |
| 1416 | this._destroyed.complete(); |
| 1417 | } |
| 1418 | |
| 1419 | getParent(): CdkTreeNode<T, K> | null { |
| 1420 | return this._tree._getNodeParent(this) ?? null; |