[Bug 24257] TpAccount, TpAccountManager: prepare never terminates if the object is invalidated

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 28 13:37:08 CET 2009


http://bugs.freedesktop.org/show_bug.cgi?id=24257





--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk>  2009-10-28 05:37:08 PST ---
(In reply to comment #3)
> Looking at the code, it seems that the only place where prepare_async is called
> is from tp_account_manager_ensure_account.

Isn't it public API? I'm pretty sure it is. If so, then the only place where it
is called is "anywhere" :-P

> There is an _tp_account_manager_account_invalidated_cb but it is only
> registered if/when prepare finishes successfully. Also, it only listens for
> domain == TP_DBUS_ERRORS && code == TP_DBUS_ERROR_OBJECT_REMOVED. Are there any
> other cases/reasons why an account might be invalidated?

A TpProxy can be invalidated for any reason at any time. It shouldn't ever be
invalidated twice, and after it has been invalidated once, prepare_async should
notice that tp_proxy_get_invalidated() returns a non-NULL GError, and just fail
with that GError "immediately" (i.e. soon, in an idle).

> 2) For completeness if anyone else wants to call prepare_async and get called
> back.
> 
> define _tp_account_invalidated_cb () which loops over priv->callbacks and makes
> them all fail. I think I know how to do this, after reading the gio docs.
> 
> Register invalidated_cb with the invalidated signal (somewhere inside
> _tp_account_constructed)

Yes, please do this.

> I suspect that there's some memory management that's going to mess me up here:
> If you connect to a signal on yourself, does it add a ref to you like it does
> in python? If so then will we be kept alive forever?

I don't think connecting to your own signal does ref you, unless you explicitly
ref the user_data passed to the signal, so it should be OK. Check with
refdbg...

> Also: do you want a test for this?

Yes please, if possible. I realise that making a stub Account with appropriate
behaviour could be tricky, though.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list