See http://cgit.collabora.com/git/user/xclaesse/telepathy-glib.git/log/?h=leak
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.
Merged into master then. With the small change your suggested.
*** Bug 48471 has been marked as a duplicate of this bug. ***
Fix released in 0.21.0.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.