[Bug 63027] TpConnection and TpContact are leaked

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Apr 2 17:37:42 CEST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=63027

--- Comment #1 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
The first commit is fine.

----

I thought I dimly remembered some discussion about why breaking this cycle was
not as trivial as it looked. Bug #49373 is related, and was fixed in next (in
an incompatible way).

tp_connection_get_self_handle() and tp_connection_get_self_contact() both look
at the self-contact. With this change, they will produce different results
after invalidation. Are we OK with that?

tp_connection_get_self_handle() is not useful anyway, because handles are
useless after invalidation; but tp_connection_get_self_contact() can be used to
get the identifier, which is still relevant.

I don't have an answer for that. I suppose we could consider toggle-refs, but
then we have two problems (only GObject gurus understand toggle-refs, and the
leak would still be present when used in conjunction with language bindings).

----

In the third commit:

+    {
+      g_object_add_weak_pointer ((GObject *) f->client_conn,
+          (gpointer *) &f->client_conn);
+      tp_tests_connection_assert_disconnect_succeeds (f->client_conn);
+      g_object_unref (f->client_conn);
+      g_assert (f->client_conn == NULL);
+    }

I think this would be clearer if it used a separate pointer for the weak
reference. I had to read it several times to see that it was actually OK.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list