forked from EVOgeek/Vmeda.Online
		
	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).
This commit is contained in:
		
							parent
							
								
									61f8d8c242
								
							
						
					
					
						commit
						c94785a94f
					
				| @ -340,7 +340,9 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | ||||
|     ngOnDestroy(): void { | ||||
|         this.undeleteEventObserver?.off(); | ||||
|         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.manager?.getSource().forgetRelatedSources(); | ||||
|         this.manager?.destroy(); | ||||
|         this.managerUnsubscribe && this.managerUnsubscribe(); | ||||
|         this.managerUnsubscribe?.(); | ||||
| 
 | ||||
|         delete this.manager; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -314,8 +314,10 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy { | ||||
|      * @inheritdoc | ||||
|      */ | ||||
|     ngOnDestroy(): void { | ||||
|         this.managerUnsubscribe && this.managerUnsubscribe(); | ||||
|         this.manager?.destroy(); | ||||
|         this.managerUnsubscribe?.(); | ||||
| 
 | ||||
|         delete this.manager; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user