From 5ab1bd3248d61b0a3fd9aeb96bdb340dfeb76ce8 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Mon, 30 Dec 2024 10:41:17 +0100 Subject: [PATCH] 122464: Fixed memory leak when initComponentInstance is called multiple times --- 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 d67efcb5bdc..fa2524f5568 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -69,6 +69,9 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges } initComponentInstance(changes?: SimpleChanges) { + if (hasValue(this.themeSub)) { + this.themeSub.unsubscribe(); + } this.themeSub = this.themeService?.getThemeName$().subscribe(() => { this.renderComponentInstance(changes); });