mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-24 07:58:34 +01:00
fix NPE
It happened when too many timers were firing, but I think this code's better anyway.
This commit is contained in:
parent
271d43808f
commit
3dbec328af
1 changed files with 9 additions and 6 deletions
|
@ -1131,13 +1131,16 @@ public class BTService extends XWService {
|
||||||
|
|
||||||
private void stopListener()
|
private void stopListener()
|
||||||
{
|
{
|
||||||
m_listener.stopListening();
|
BTListenerThread listener = m_listener;
|
||||||
try {
|
if ( listener != null ) {
|
||||||
m_listener.join( 100 );
|
m_listener = null;
|
||||||
} catch ( InterruptedException ie ) {
|
listener.stopListening();
|
||||||
Log.ex( TAG, ie );
|
try {
|
||||||
|
listener.join( 100 );
|
||||||
|
} catch ( InterruptedException ie ) {
|
||||||
|
Log.ex( TAG, ie );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_listener = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopSender()
|
private void stopSender()
|
||||||
|
|
Loading…
Add table
Reference in a new issue