Skip to content

Commit

Permalink
122464: Fixed memory leak when initComponentInstance is called multip…
Browse files Browse the repository at this point in the history
…le times
  • Loading branch information
alexandrevryghem committed Dec 30, 2024
1 parent e4b386b commit 5ab1bd3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/shared/theme-support/themed.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
}

initComponentInstance(changes?: SimpleChanges) {
if (hasValue(this.themeSub)) {
this.themeSub.unsubscribe();
}
this.themeSub = this.themeService?.getThemeName$().subscribe(() => {
this.renderComponentInstance(changes);
});
Expand Down

0 comments on commit 5ab1bd3

Please sign in to comment.