Skip to content

Commit 62f1566

Browse files
122464: Fixed a memory leak when initComponentInstance is called multiple times
1 parent a0d98be commit 62f1566

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
8484
}
8585

8686
initComponentInstance(changes?: SimpleChanges) {
87+
if (hasValue(this.themeSub)) {
88+
this.themeSub.unsubscribe();
89+
}
8790
this.themeSub = this.themeService?.getThemeName$().subscribe(() => {
8891
this.renderComponentInstance(changes);
8992
});

0 commit comments

Comments
 (0)