Hi,<br><br>I am having troubles when calling g_object_unref() with a dbus registered object. <br>Can someone tell me if I am doing something wrong...<br><br>I have traced a modified dbus-glib/dbus/examples<div>/example-service.c
with gdb, without success.<br><br>This patch could explain what I want to do:<br><div><ol><li><div>diff --git a/dbus/examples/example-service.c b/dbus/examples/example-service.c</div></li><li><div>index a66855c..8e39246
<span>100644</span></div></li><li><div>--- a/dbus/examples/example-service.c</div></li><li><div>+++ b/dbus/examples/example-service.c</div></li><li><div>@@ -<span>101</span>,<span>6</span> +<span>101</span>,<span>16</span>
@@ some_object_get_dict <span>(</span>SomeObject *obj, G</div>
</li><li><div> return TRUE;</div></li><li><div> <span>}</span></div></li><li><div> </div></li><li><div>+static gboolean</div></li><li><div>
+cb_<span>1</span><span>(</span>gpointer data<span>)</span></div></li><li><div>+<span>{</span></div></li><li><div>+ SomeObject *obj;</div></li><li><div>
+</div></li><li><div>+ obj = SOME_OBJECT <span>(</span>data<span>)</span>;</div></li><li><div>+ g_object_unref <span>(</span>obj<span>)
</span>;</div></li><li><div>+ return FALSE;</div></li><li><div>+<span>}</span></div></li><li><div>+</div></li><li><div> int</div></li><li><div>
main <span>(</span>int argc, char **argv<span>)</span></div></li><li><div> <span>{</span></div></li><li><div>@@ -<span>147</span>,<span>
6</span> +<span>157</span>,<span>7</span> @@ main <span>(</span>int argc, char **argv<span>)</span></div></li><li><div> </div></li><li><div> printf
<span>(</span>"service running\n"<span>)</span>;</div></li><li><div> </div></li><li><div>+ g_timeout_add <span>(</span><span>1000
</span>, cb_<span>1</span>, obj<span>)</span>;</div></li><li><div> g_main_loop_run <span>(</span>mainloop<span>)</span>;</div></li><li><div> </div>
</li><li><div> exit <span>(</span><span>0</span><span>)</span>; </div></li></ol></div>And the step-by-step session with gdb & dbus-monitor: <a href="http://pastebin.ca/108652">http://pastebin.ca/108652</a><br><br>Unfortunately, after g_object_unref, the service is still there...
<br> dbus_g_proxy_new_for _name_owner is notified once the program is dead...
<br>but I would like to be notified before :)<br><br>org_freedesktop_DBus_release_name() does not help me neither :(<br><br>I am running dapper, with 0.60 version of DbUs (you haven't see that one before, have you?)<br>
And I have tested it on DBus 0.92..<br><br>What should I do instead ?<br>
<br>cheers,</div><br clear="all"><br>-- <br>Marc-André Lureau, GSmartMix