Skip to content

Commit 1426617

Browse files
author
Vito Caputo
committed
Fix dbus connection leaks introduced with sigconn
1 parent b8993eb commit 1426617

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dbus/dbus.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func NewUserConnection() (*Conn, error) {
101101
// Close closes an established connection
102102
func (c *Conn) Close() {
103103
c.sysconn.Close()
104+
c.sigconn.Close()
104105
}
105106

106107
func newConnection(createBus func() (*dbus.Conn, error)) (*Conn, error) {
@@ -111,6 +112,7 @@ func newConnection(createBus func() (*dbus.Conn, error)) (*Conn, error) {
111112

112113
sigconn, err := dbusConnection(createBus)
113114
if err != nil {
115+
sysconn.Close()
114116
return nil, err
115117
}
116118

0 commit comments

Comments
 (0)