Skip to content

Commit c89ad9f

Browse files
122464: Fixed a memory leak when initComponentInstance is called multiple times
(cherry picked from commit 62f1566)
1 parent 391e87a commit c89ad9f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/app/shared/theme-support/themed.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export abstract class ThemedComponent<T> implements AfterViewInit, OnDestroy, On
8282
}
8383

8484
initComponentInstance(changes?: SimpleChanges) {
85+
if (hasValue(this.themeSub)) {
86+
this.themeSub.unsubscribe();
87+
}
8588
this.themeSub = this.themeService?.getThemeName$().subscribe(() => {
8689
this.renderComponentInstance(changes);
8790
});

0 commit comments

Comments
 (0)