From 48b1dfee113c9cd0371afc586dc98abebfb6e1d0 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 9 Jan 2025 18:57:19 +0100 Subject: [PATCH] fix: close signal on Connect for Linux platform to address issues raised in #262 Signed-off-by: deadprogram --- gap_linux.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gap_linux.go b/gap_linux.go index 9c46abb..a03b5e1 100644 --- a/gap_linux.go +++ b/gap_linux.go @@ -348,6 +348,7 @@ func (a *Adapter) Connect(address Address, params ConnectionParams) (Device, err // were connected between the two calls the signal wouldn't be picked up. signal := make(chan *dbus.Signal) a.bus.Signal(signal) + defer close(signal) defer a.bus.RemoveSignal(signal) propertiesChangedMatchOptions := []dbus.MatchOption{dbus.WithMatchInterface("org.freedesktop.DBus.Properties")} a.bus.AddMatchSignal(propertiesChangedMatchOptions...)