fix: deactivate themes on deinit

This commit is contained in:
Mo Bitar
2020-09-24 19:08:45 -05:00
parent e177dcac47
commit 83771339a5
3 changed files with 14 additions and 4 deletions

View File

@@ -55,11 +55,15 @@ class ComponentViewCtrl implements ComponentViewScope {
}
$onDestroy() {
this.application.componentManager.onComponentIframeDestroyed(this.component.uuid);
if(this.application.componentManager) {
/** Component manager Can be destroyed already via locking */
this.application.componentManager.onComponentIframeDestroyed(this.component.uuid);
if(this.templateComponent) {
this.application.componentManager.removeTemporaryTemplateComponent(this.templateComponent);
}
}
if(this.liveComponent) {
this.liveComponent.deinit();
} else {
this.application.componentManager.removeTemporaryTemplateComponent(this.templateComponent);
}
this.cleanUpOn();
(this.cleanUpOn as any) = undefined;