After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631010 - Close the bus connection for buses different of Session bus and System bus
Close the bus connection for buses different of Session bus and System bus
Status: RESOLVED FIXED
Product: d-feet
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: johnp
Depends on:
Blocks:
 
 
Reported: 2010-09-30 14:16 UTC by Florent Viard
Modified: 2010-10-01 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch associated with this report (1.96 KB, patch)
2010-09-30 14:17 UTC, Florent Viard
committed Details | Review

Description Florent Viard 2010-09-30 14:16:53 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.
Comment 1 Florent Viard 2010-09-30 14:17:33 UTC
Created attachment 171426 [details] [review]
Patch associated with this report
Comment 2 johnp 2010-09-30 21:04:01 UTC
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.
Comment 3 Florent Viard 2010-10-01 10:08:58 UTC
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 4 johnp 2010-10-01 21:07:57 UTC
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.