MOBILE-4081 addons: Delete manager instances
This prevents errors for trying to get the source of a destroyed manager (for example, for subsequent asynchronous calls fetching data).main
parent
61f8d8c242
commit
c94785a94f
|
@ -340,7 +340,9 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.undeleteEventObserver?.off();
|
this.undeleteEventObserver?.off();
|
||||||
this.manager?.destroy();
|
this.manager?.destroy();
|
||||||
this.managerUnsubscribe && this.managerUnsubscribe();
|
this.managerUnsubscribe?.();
|
||||||
|
|
||||||
|
delete this.manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,7 +457,9 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
|
||||||
this.filterChangedObserver?.off();
|
this.filterChangedObserver?.off();
|
||||||
this.manager?.getSource().forgetRelatedSources();
|
this.manager?.getSource().forgetRelatedSources();
|
||||||
this.manager?.destroy();
|
this.manager?.destroy();
|
||||||
this.managerUnsubscribe && this.managerUnsubscribe();
|
this.managerUnsubscribe?.();
|
||||||
|
|
||||||
|
delete this.manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,8 +314,10 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy {
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.managerUnsubscribe && this.managerUnsubscribe();
|
|
||||||
this.manager?.destroy();
|
this.manager?.destroy();
|
||||||
|
this.managerUnsubscribe?.();
|
||||||
|
|
||||||
|
delete this.manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue