[Bug]:A goroutine memory leak
xuxiaofan1203 opened this issue · 1 comments
xuxiaofan1203 commented
Hello @marselester, the dbus is very useful, but I found a potential bug when I used it.
blocking position:
Line 302 in 7623695
In the test function TestSessionBus, after using the newConn, there is no newConn.Close() to awaken the <-conn.ctx.Done(). So the goroutine will block at the <-conn.ctx.Done(). We can call newConn.Close() to fix the bug probably.
Lines 26 to 32 in 7623695
you could reproduce the bug using goleak in the func TestSessionBus like this
Lzyyyds6 commented
Yes, I found the bug too. The newConn should be closed to awaken the ctx.Done().