fix: 后置机拿不到信号问题
This commit is contained in:
		
							parent
							
								
									7bd3689593
								
							
						
					
					
						commit
						a52a13e6d9
					
				| @ -12,9 +12,6 @@ class differentialAndSignal { | ||||
| 
 | ||||
|   // 初始化Worker | ||||
|   init() { | ||||
|     if (this.workerInstance) { | ||||
|       this.close(); | ||||
|     } | ||||
|     this.workerInstance = new worker.ThreadWorker("entry/ets/workers/DifferentialCorrection.ets"); | ||||
|     let config: EnvironmentConfigurationType = | ||||
|       AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || { | ||||
| @ -55,20 +52,15 @@ class differentialAndSignal { | ||||
| 
 | ||||
|   // 关闭 | ||||
|   close() { | ||||
|     if (this.workerInstance) { | ||||
|       // 清空所有监听器 | ||||
|     this.events = []; | ||||
| 
 | ||||
|       // 发送关闭消息 | ||||
|       const config = AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {}; | ||||
|     const config: EnvironmentConfigurationType = AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || { | ||||
|     } | ||||
|     this.workerInstance.postMessage(JSON.stringify({ | ||||
|       config: config, | ||||
|       close: true | ||||
|     })); | ||||
| 
 | ||||
|     // 关闭线程 | ||||
|       this.workerInstance.terminate(); | ||||
|     } | ||||
|     this.workerInstance.terminate() | ||||
|   } | ||||
| 
 | ||||
|   // 获取Worker消息 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user