[miele] Properly shut down event listener job upon dispose (#9202)
Signed-off-by: Kai Kreuzer <kai@openhab.org>pull/9213/head
parent
072113f51b
commit
102f770881
|
@ -398,7 +398,12 @@ public class MieleBridgeHandler extends BaseBridgeHandler {
|
|||
listener.onAppliancePropertyChanged(uid, dp);
|
||||
}
|
||||
} catch (SocketTimeoutException e) {
|
||||
Thread.sleep(500);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException ex) {
|
||||
logger.debug("Eventlistener has been interrupted.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
@ -633,5 +638,9 @@ public class MieleBridgeHandler extends BaseBridgeHandler {
|
|||
pollingJob.cancel(true);
|
||||
pollingJob = null;
|
||||
}
|
||||
if (eventListenerJob != null) {
|
||||
eventListenerJob.cancel(true);
|
||||
eventListenerJob = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue