Skip to content

Commit acfed26

Browse files
authored
Fix exception when stopping Thing (#20434)
Resolves #20433 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
1 parent 74e58df commit acfed26

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal

bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBridgeHandler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,17 @@ public void dispose() {
111111

112112
Future<?> job = discoveryJob;
113113
if (job != null) {
114-
job.cancel(false);
114+
job.cancel(true);
115115
discoveryJob = null;
116116
}
117117

118118
BluetoothAdapter adapter = this.adapter;
119119
if (adapter != null) {
120-
adapter.stopDiscovery();
120+
try {
121+
adapter.stopDiscovery();
122+
} catch (DBusExecutionException e) {
123+
logger.debug("Failed to stop discovery on adapter during disposal", e);
124+
}
121125
this.adapter = null;
122126
}
123127

0 commit comments

Comments
 (0)