GNOME Bugzilla – Bug 667535
persona created by tpf_persona_dup_for_contact() outlives its TpContact
Last modified: 2012-01-09 16:32:52 UTC
Created attachment 204857 [details] test app See attached test app. When running it using Danni's libgobject-list module ( git://git.collabora.co.uk/git/user/danni/gobject-list.git ) I get this: $ LD_PRELOAD=/home/cassidy/dev/gobject-list/libgobject-list.so GOBJECT_LIST_FILTER=Tp ./a.out ++ Created object 0x1be8060, TpDBusDaemon ++ Created object 0x1be6990, TpAutomaticClientFactory ++ Created object 0x1bea820, TpAccountManager ++ Created object 0x1bf1070, TpAccount ++ Created object 0x1bf11f0, TpAccount ++ Created object 0x1bf1370, TpAccount ++ Created object 0x1bf14f0, TpAccount ++ Created object 0x1bf1670, TpAccount ++ Created object 0x1bf17f0, TpAccount ++ Created object 0x1bf1970, TpAccount ++ Created object 0x1bf1af0, TpAccount ++ Created object 0x1bf1c70, TpAccount ++ Created object 0x1bf1df0, TpAccount ++ Created object 0x1bff070, TpAccount ++ Created object 0x1bff1f0, TpAccount ++ Created object 0x1bff370, TpAccount ++ Created object 0x1bff4f0, TpAccount ++ Created object 0x1bff670, TpAccount ++ Created object 0x1bff7f0, TpAccount ++ Created object 0x1bff970, TpAccount ++ Created object 0x1bffaf0, TpAccount ++ Created object 0x1c1b060, TpConnection ++ Created object 0x1c1b210, TpConnection ++ Created object 0x1c1b3c0, TpConnection ++ Created object 0x1c1b570, TpConnection ++ Created object 0x1c1b720, TpConnection ++ Created object 0x1c1b8d0, TpConnection ++ Created object 0x1c1ba80, TpConnection ++ Created object 0x1c2b810, TpContact ++ Created object 0x1c2b8d0, TpContact ++ Created object 0x1c2b990, TpContact ++ Created object 0x1c2ba50, TpContact ++ Created object 0x1c2bb10, TpContact ++ Created object 0x1c2bbd0, TpContact ++ Created object 0x1c2bc90, TpContact ++ Created object 0x1c2bd50, TpContact telepathy-DEBUG: tpf-persona.vala:1106: Tpf.Persona.dup_for_contact (0x1c2bd50): got account 0x1bffaf0 telepathy-DEBUG: tpf-persona-store.vala:2531: Tpf.PersonaStore.dup_for_account (0x1bffaf0): telepathy-DEBUG: tpf-persona-store.vala:2547: Creating new PersonaStore. folks-DEBUG: persona-store.vala:285: Constructing PersonaStore ?/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0? (0x1c2d020) telepathy-DEBUG: tpf-persona-store.vala:258: Creating new Tpf.PersonaStore 0x1c2d020 ('/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0') for TpAccount 0x1bffaf0. GLib-GObject-CRITICAL **: Read-only property 'read-only-view' on class 'GeeAbstractSet' has type 'GeeCollection' which is not equal to or more restrictive than the type 'GeeSet' of the property on the interface 'GeeSet' telepathy-DEBUG: tpf-persona-store.vala:2465: Adding PersonaStore 0x1c2d020 ('/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0') to map. folks-DEBUG: object-cache.vala:156: Creating object cache for type ID 'tpf-persona-stores' with ID '/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0'. ++ Created object 0x1c37040, TpfPersonaStoreCache telepathy-DEBUG: tpf-persona-store.vala:499: Resetting Tpf.PersonaStore 0x1c2d020 ('/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0') GLib-GObject-CRITICAL **: Read-only property 'read-only-view' on class 'GeeReadOnlySet' has type 'GeeCollection' which is not equal to or more restrictive than the type 'GeeSet' of the property on the interface 'GeeSet' ++ Created object 0x1c2d020, TpfPersonaStore telepathy-DEBUG: Ensuring contact 0x1c2bd50 (handle: 106) exists in Tpf.PersonaStore 0x1c2d020 ('/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0'). telepathy-DEBUG: tpf-persona-store.vala:2017: Adding persona from contact 'noinroster@jabber.org' ++ Created object 0x1c2e140, TpfPersona telepathy-DEBUG: tpf-persona.vala:631: Created new Tpf.Persona 'telepathy:/org/freedesktop/Telepathy/Account/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe0:noinroster@jabber.org' for service-specific UID 'noinroster@jabber.org': 0x1c2e140 telepathy-DEBUG: tpf-persona-store.vala:2038: Setting is-in-contact-list to false folks-DEBUG: individual.vala:955: Creating new Individual with 0 Personas: 0x1c4b000 check ok UNREF individual folks-DEBUG: individual.vala:971: Destroying Individual 'bd0bf23fab7d3b5aedaa2ca87959329eb39c7554': 0x1c4b000 -- Finalized object 0x1c2bd50, TpContact telepathy-DEBUG: tpf-persona-store.vala:1541: Ignoring handle 0 (persona: (nil)) As you can see the TpContact is destroyed but the TpfPersona is not. That's pretty annoying as a second call to dup_for_contact() may return this persona but with no TpContact associated.
Awesome, your patch fixes my test case and even my Empathy bug (bug #667399). Thanks!
*** Bug 667399 has been marked as a duplicate of this bug. ***
Created attachment 204884 [details] [review] Fix weak notification of TpContacts Patch merged. Attached here for posterity: commit 1e3cde1b510a936832b04e741f634dda72d943d3 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Mon Jan 9 14:47:02 2012 +0000 telepathy: Fix weak notification of TpContacts By the time our weak notification callback was called, the TpContact’s handle had been set to 0, which mucked things up for us. Closes: https://bugzilla.gnome.org/show_bug.cgi?id=667535 NEWS | 2 + backends/telepathy/lib/tpf-persona-store.vala | 36 ++++++++++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-)