fix, sciter, reconnect, check thread running before the state
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
		
							parent
							
								
									92213f9228
								
							
						
					
					
						commit
						0a60d7016d
					
				@ -888,10 +888,12 @@ impl<T: InvokeUiSession> Session<T> {
 | 
				
			|||||||
        // 2. If the connection is established, send `Data::Close`.
 | 
					        // 2. If the connection is established, send `Data::Close`.
 | 
				
			||||||
        // 3. If the connection is disconnected, do nothing.
 | 
					        // 3. If the connection is disconnected, do nothing.
 | 
				
			||||||
        let mut connection_round_state_lock = self.connection_round_state.lock().unwrap();
 | 
					        let mut connection_round_state_lock = self.connection_round_state.lock().unwrap();
 | 
				
			||||||
        match connection_round_state_lock.state {
 | 
					        if self.thread.lock().unwrap().is_some() {
 | 
				
			||||||
            ConnectionState::Connecting => return,
 | 
					            match connection_round_state_lock.state {
 | 
				
			||||||
            ConnectionState::Connected => self.send(Data::Close),
 | 
					                ConnectionState::Connecting => return,
 | 
				
			||||||
            ConnectionState::Disconnected => {}
 | 
					                ConnectionState::Connected => self.send(Data::Close),
 | 
				
			||||||
 | 
					                ConnectionState::Disconnected => {}
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        let round = connection_round_state_lock.new_round();
 | 
					        let round = connection_round_state_lock.new_round();
 | 
				
			||||||
        drop(connection_round_state_lock);
 | 
					        drop(connection_round_state_lock);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user