It happened when too many timers were firing, but I think this code's
better anyway.
This commit is contained in:
Eric House 2018-12-04 19:59:42 -08:00
parent 271d43808f
commit 3dbec328af

View file

@ -1131,13 +1131,16 @@ public class BTService extends XWService {
private void stopListener() private void stopListener()
{ {
m_listener.stopListening(); BTListenerThread listener = m_listener;
if ( listener != null ) {
m_listener = null;
listener.stopListening();
try { try {
m_listener.join( 100 ); listener.join( 100 );
} catch ( InterruptedException ie ) { } catch ( InterruptedException ie ) {
Log.ex( TAG, ie ); Log.ex( TAG, ie );
} }
m_listener = null; }
} }
private void stopSender() private void stopSender()