DBus GObject & g_object_unref

Marc-André Lureau marcandre.lureau at gmail.com
Mon Jul 31 15:25:11 PDT 2006


Given a gobject service:
  dbus_g_connection_register_g_object (bus, "/SomeObject", G_OBJECT (obj));

This gobject could release the service he provides, this way:
g_object_unref (obj);
  and dbus_g_proxy_call (bus_proxy, "ReleaseName", &error,
              G_TYPE_STRING, "org.designfu.SampleService",
              G_TYPE_INVALID,
              G_TYPE_UINT, &request_name_result,
              G_TYPE_INVALID))

I would like to have a proxy notified when the gobject service has released
the service, or
has been destroyed.
  proxy = dbus_g_proxy_new_for_name_owner (bus, "org.designfu.SampleService",

                       "/SomeObject", "org.designfu.SampleInterface",
&error);
either with a weak ref:
  g_object_weak_ref (proxy, (GWeakNotify)_proxy_destroy, NULL);
or a distroy signal (I use the "name_owner" proxy):
  g_signal_connect(proxy, "destroy",
           G_CALLBACK(_proxy_destroy), proxy);

Unfortunately, the proxy destroy signal is emited only when the process
where the service-object is living is terminated (killed or exited).

I think it's related to a "1:xxx" id still on the bus after the unref...

I hope you will understand what I am talking about,  I am sorry to have a so
poor english and not a deep understanding of dbus...

Thanks,

On 7/31/06, John (J5) Palmieri <johnp at redhat.com> wrote:
>
> I'm not totally sure what you want either.  What exactly should be
> happening?  Is destroy not getting called when you do the unref?  The
> ReleaseName call should generate a NameOwnerChanged signal.  If not it
> is a bug.
>
> On Mon, 2006-07-31 at 15:47 -0400, Havoc Pennington wrote:
> >
> > Marc-André Lureau wrote:
> > > The two process exist in my project, but I can't get the signal
> > > in the proxy process owner.
> > >
> > > And in the modified example-service.c,  there is only one process
> > > and no notification neither.
> > >
> > > Should I read some DBus code now?
> > >
> > > (cf. http://pastebin.ca/108858)
> > >
> > >
> >
> > I think I don't understand what you're asking...
> >
> > Havoc
> > _______________________________________________
> > dbus mailing list
> > dbus at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dbus
> --
> John (J5) Palmieri <johnp at redhat.com>
>
>


-- 
Marc-André Lureau, GSmartMix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20060801/11c2cc66/attachment.html


More information about the dbus mailing list