Skip to content

Commit 5007856

Browse files
duanjuKhushbuShah25
authored andcommitted
fix the gatt client leak
android register new gatt client internally, when we call the function BluetoothDevice .connect(Boolean autoConnect, BluetoothGattCallback callback, Handler handler). To avoid leak, the client need to be recyled/unregisted by calling close before creating. https://cs.android.com/android/platform/superproject/main/+/main:packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothGatt.java;drc=cfeac0c69463c7500b6fd86aa3843406f89928d3;l=1085
1 parent f8b5085 commit 5007856

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

provisioning/src/main/java/com/espressif/provisioning/transport/BLETransport.java

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public void disconnect() {
151151

152152
if (this.bluetoothGatt != null) {
153153
this.bluetoothGatt.disconnect();
154+
this.bluetoothGatt.close();
154155
bluetoothGatt = null;
155156
}
156157
}

0 commit comments

Comments
 (0)