Use improved shutdown for daemon command

This commit is contained in:
AsamK 2023-11-09 18:50:07 +01:00
parent b7fedff511
commit 1058e33f12
3 changed files with 64 additions and 18 deletions

View file

@ -62,7 +62,7 @@ import java.util.stream.Collectors;
import static org.asamk.signal.dbus.DbusUtils.makeValidObjectPathElement;
public class DbusSignalImpl implements Signal {
public class DbusSignalImpl implements Signal, AutoCloseable {
private final Manager m;
private final DBusConnection connection;
@ -108,6 +108,7 @@ public class DbusSignalImpl implements Signal {
updateIdentities();
}
@Override
public void close() {
if (dbusMessageHandler != null) {
m.removeReceiveHandler(dbusMessageHandler);