Skip to content

Commit

Permalink
Making sure all resources are released
Browse files Browse the repository at this point in the history
  • Loading branch information
philips77 committed Jul 28, 2020
1 parent 6203896 commit 78a0e92
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,10 @@ protected void waitFor(final long millis) {
*/
protected void close(@NonNull final BluetoothGatt gatt) {
logi("Cleaning up...");
// Call disconnect() to make sure all resources are released. The device should already be
// disconnected, but that's OK.
sendLogBroadcast(LOG_LEVEL_DEBUG, "gatt.disconnect()");
gatt.disconnect();
sendLogBroadcast(LOG_LEVEL_DEBUG, "gatt.close()");
gatt.close();
mConnectionState = STATE_CLOSED;
Expand Down

0 comments on commit 78a0e92

Please sign in to comment.