GNOME Bugzilla – Bug 631010
Close the bus connection for buses different of Session bus and System bus
Last modified: 2010-10-01 21:08:30 UTC
Close the bus connection when we close a connection tab for the buses different than Session Bus and System Bus. + Fix a potential bug.
Created attachment 171426 [details] [review] Patch associated with this report
Have you checked to see what happens when two of the same bus tabs are open and one is closed? I can't remember if BusAddress opens up a shared connection or a private one. Also check out what happens if you open and close a system or session bus using its address. Otherwise patch looks good.
In my patch, i don't call close if the bus is Session bus or System bus, when i tried, the application closed itself when trying to close the session bus. For the BusAddress connection, i'm not sure because the dbus-proxy that i use on the other side accepts only one connection at a time. But here is what i think from d-feet source code: Here is what the dbus doc say: " A connection to one of three possible standard buses, the SESSION, SYSTEM, or STARTER bus. This class manages shared connections to those buses. If you're trying to subclass Bus, you may be better off subclassing BusConnection, which doesn't have all this magic. " And d-feet source code is: " if bus == SESSION_BUS: self.bus = dbus.SessionBus() elif bus == SYSTEM_BUS: self.bus = dbus.SystemBus() else: if not address: raise BusAddressError(address) self.bus = dbus.bus.BusConnection(address) " So I suppose that the SessionBus and SystemBus connections are shared, but the BusAdress one is not as it uses BusConnection. And so, there should not be a problem if two of the same bus tabs are open and one is closed.
Comment on attachment 171426 [details] [review] Patch associated with this report Tried it with the session bus address and it worked fine. Committed. There was a trailing whitespace error in the patch which I had to rebase. Please make sure you don't have trailing whitespace when submitting a patch. Git should complain when you do a commit. Thanks for the patch.