[Fwd: Re: [gphoto-devel] EOS 350D capture]

Havoc Pennington hp at redhat.com
Fri Dec 22 09:53:18 PST 2006


oliver frommel wrote:
> Ok, so will I just leave the unref away for older versions.
> Can you tell me which versions I need to consider?

I'm not sure exactly when unref became safe; I would suggest just never 
unref'ing if the version is before 1.0

> Does not unref'ing the connection not leave any claimed ressources
> in the dbus daemon?

The daemon will clean up when your app exits or disconnects, so the 
unref is purely about freeing the DBusConnection object in your own 
process. This connection will be kept around by libdbus until it's 
disconnected in any case, even if you unref. So the unref only matters 
if the connection disconnects. For the session bus connection, normally 
the connection only disconnects if the user logs out. So basically on 
logout, if your app keeps running after logout, you would leak some 
memory. If your app exits on logout anyway (which is the default), then 
the unref doesn't matter.

Havoc



More information about the dbus mailing list