diff options
author | Sven Gothel <[email protected]> | 2022-02-08 13:06:08 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-02-08 13:06:08 +0100 |
commit | a1ea89e5cd1d98b42e7a236160d83fd7104c9027 (patch) | |
tree | 1ab9f7f230427628afb0368419b4053dc728d018 /examples/java/DBTPeripheral00.java | |
parent | f618578f53213a3e5599ffbe44a09a09b7d046e1 (diff) |
DBTPeripheral00/DBTServer00: Issue device.remove() in processDisconnectedDevice(..)
device.remove() shall ensure to clear all device references from its BTAdapter to avoid leaks.
Diffstat (limited to 'examples/java/DBTPeripheral00.java')
-rw-r--r-- | examples/java/DBTPeripheral00.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/java/DBTPeripheral00.java b/examples/java/DBTPeripheral00.java index 8589258e..1de34acb 100644 --- a/examples/java/DBTPeripheral00.java +++ b/examples/java/DBTPeripheral00.java @@ -621,7 +621,9 @@ public class DBTPeripheral00 { // already unpaired stopAdvertising(device.getAdapter(), "device-disconnected"); + device.remove(); BTDeviceRegistry.removeFromProcessingDevices(device.getAddressAndType()); + try { Thread.sleep(100); // wait a little (FIXME: Fast restart of advertising error) } catch (final InterruptedException e) { } |