File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ def __init__(
5353 self ._receiveThread .start ()
5454 logging .debug ("Threads running" )
5555
56+ self .client : Optional [BLEClient ] = None
5657 try :
5758 logging .debug (f"BLE connecting to: { address if address else 'any' } " )
58- self .client : Optional [ BLEClient ] = self .connect (address )
59+ self .client = self .connect (address )
5960 logging .debug ("BLE connected" )
6061 except BLEInterface .BLEError as e :
6162 self .close ()
@@ -207,7 +208,6 @@ def _sendToRadioImpl(self, toRadio):
207208 self .should_read = True
208209
209210 def close (self ):
210- atexit .unregister (self ._exit_handler )
211211 try :
212212 MeshInterface .close (self )
213213 except Exception as e :
@@ -219,6 +219,7 @@ def close(self):
219219 self ._receiveThread = None
220220
221221 if self .client :
222+ atexit .unregister (self ._exit_handler )
222223 self .client .disconnect ()
223224 self .client .close ()
224225 self .client = None
You can’t perform that action at this time.
0 commit comments