1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

AndroidGCS: Somehow multiple disconnects were triggered.

This commit is contained in:
James Cotton 2012-08-10 02:09:32 -05:00
parent 91a8186e54
commit 7c6b81517e

View File

@ -128,14 +128,15 @@ public class OPTelemetryService extends Service {
case MSG_DISCONNECT:
Toast.makeText(getApplicationContext(), "Disconnect requested", Toast.LENGTH_SHORT).show();
terminate = true;
activeTelem.interrupt();
try {
activeTelem.join();
} catch (InterruptedException e) {
e.printStackTrace();
if (activeTelem != null) {
activeTelem.interrupt();
try {
activeTelem.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
activeTelem = null;
}
activeTelem = null;
Intent intent = new Intent();
intent.setAction(INTENT_ACTION_DISCONNECTED);
sendBroadcast(intent,null);