122464: Fixed a memory leak when initComponentInstance is called multiple times

(cherry picked from commit 62f15668b6)
This commit is contained in:
Alexandre Vryghem
2025-05-02 17:11:48 +02:00
parent 391e87a11f
commit c89ad9f22a

View File

@@ -82,6 +82,9 @@ export abstract class ThemedComponent<T> implements AfterViewInit, OnDestroy, On
}
initComponentInstance(changes?: SimpleChanges) {
if (hasValue(this.themeSub)) {
this.themeSub.unsubscribe();
}
this.themeSub = this.themeService?.getThemeName$().subscribe(() => {
this.renderComponentInstance(changes);
});