From c89ad9f22ae94ce6fb5348460d886c399cbf898d Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 2 May 2025 17:11:48 +0200 Subject: [PATCH] 122464: Fixed a memory leak when initComponentInstance is called multiple times (cherry picked from commit 62f15668b66632a81dadbb8304a8fc66d641ab9a) --- src/app/shared/theme-support/themed.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 0d2833b33f..2e2585f777 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -82,6 +82,9 @@ export abstract class ThemedComponent implements AfterViewInit, OnDestroy, On } initComponentInstance(changes?: SimpleChanges) { + if (hasValue(this.themeSub)) { + this.themeSub.unsubscribe(); + } this.themeSub = this.themeService?.getThemeName$().subscribe(() => { this.renderComponentInstance(changes); });