mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 05:23:06 +00:00
122464: Fixed a memory leak when initComponentInstance is called multiple times
(cherry picked from commit 62f15668b6
)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user