guelfey / go.dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
124 stars 42 forks source link

Should allow multiple calls to Conn.Close() #47

Open alexlarsson opened 10 years ago

alexlarsson commented 10 years ago

Calling Conn.Close() multiple time right now crashes with a panic when closing the out channel multiple times. It is typically good form to close a connection when its not used anymore, but the above makes that unsafe, because there are internal callers to Close() that you can't control (for instance on a socket read error due to a remote close). Since those happen in another thread its basically impossible to propely know if closing is safe.