explicitly destroy block scenes
This commit is contained in:
		
							parent
							
								
									6553344489
								
							
						
					
					
						commit
						9f5666f410
					
				| @ -172,12 +172,17 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On | ||||
|   ngOnDestroy(): void { | ||||
|     if (this.animationFrameRequest) { | ||||
|       cancelAnimationFrame(this.animationFrameRequest); | ||||
|       clearTimeout(this.animationHeartBeat); | ||||
|     } | ||||
|     clearTimeout(this.animationHeartBeat); | ||||
|     if (this.canvas) { | ||||
|       this.canvas.nativeElement.removeEventListener('webglcontextlost', this.handleContextLost); | ||||
|       this.canvas.nativeElement.removeEventListener('webglcontextrestored', this.handleContextRestored); | ||||
|     } | ||||
|     if (this.scene) { | ||||
|       this.scene.destroy(); | ||||
|     } | ||||
|     this.vertexArray.destroy(); | ||||
|     this.vertexArray = null; | ||||
|     this.themeChangedSubscription?.unsubscribe(); | ||||
|     this.searchSubscription?.unsubscribe(); | ||||
|   } | ||||
| @ -490,9 +495,7 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On | ||||
|     if (this.running && this.scene && now <= (this.scene.animateUntil + 500)) { | ||||
|       this.doRun(); | ||||
|     } else { | ||||
|       if (this.animationHeartBeat) { | ||||
|         clearTimeout(this.animationHeartBeat); | ||||
|       } | ||||
|       clearTimeout(this.animationHeartBeat); | ||||
|       this.animationHeartBeat = window.setTimeout(() => { | ||||
|         this.start(); | ||||
|       }, 1000); | ||||
|  | ||||
| @ -110,4 +110,12 @@ export class FastVertexArray { | ||||
|   getVertexData(): Float32Array { | ||||
|     return this.data; | ||||
|   } | ||||
| 
 | ||||
|   destroy(): void { | ||||
|     this.data = null; | ||||
|     this.sprites = null; | ||||
|     this.freeSlots = null; | ||||
|     this.lastSlot = 0; | ||||
|     this.dirty = false; | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -176,5 +176,8 @@ export class BlockViewComponent implements OnInit, OnDestroy { | ||||
|     if (this.queryParamsSubscription) { | ||||
|       this.queryParamsSubscription.unsubscribe(); | ||||
|     } | ||||
|     if (this.blockGraph) { | ||||
|       this.blockGraph.destroy(); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -428,6 +428,12 @@ export class BlockComponent implements OnInit, OnDestroy { | ||||
|     this.isAuditEnabledSubscription?.unsubscribe(); | ||||
|     this.oobSubscription?.unsubscribe(); | ||||
|     this.priceSubscription?.unsubscribe(); | ||||
|     this.blockGraphProjected.forEach(graph => { | ||||
|       graph.destroy(); | ||||
|     }); | ||||
|     this.blockGraphActual.forEach(graph => { | ||||
|       graph.destroy(); | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   // TODO - Refactor this.fees/this.reward for liquid because it is not
 | ||||
|  | ||||
| @ -162,6 +162,9 @@ export class EightBlocksComponent implements OnInit, OnDestroy { | ||||
|     this.cacheBlocksSubscription?.unsubscribe(); | ||||
|     this.networkChangedSubscription?.unsubscribe(); | ||||
|     this.queryParamsSubscription?.unsubscribe(); | ||||
|     this.blockGraphs.forEach(graph => { | ||||
|       graph.destroy(); | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   shiftTestBlocks(): void { | ||||
|  | ||||
| @ -120,6 +120,7 @@ export class MempoolBlockOverviewComponent implements OnInit, OnDestroy, OnChang | ||||
|   } | ||||
| 
 | ||||
|   ngOnDestroy(): void { | ||||
|     this.blockGraph?.destroy(); | ||||
|     this.blockSub.unsubscribe(); | ||||
|     this.timeLtrSubscription.unsubscribe(); | ||||
|     this.websocketService.stopTrackMempoolBlock(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user