[Bug 47322] [next] GCancellables for all async calls

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 19 18:25:49 CET 2012


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

--- Comment #5 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-03-19 10:25:49 PDT ---
(In reply to comment #4)
> My understanding was that once you call cancel, your other callback is
> guaranteed to never be called

No, in GIO (unlike older bits of telepathy-glib) your callback is *always*
called with either success or error. Cancellables don't change that.

If the cancellable was cancelled, the operation might fail with
G_IO_ERROR_CANCELLED, or it might succeed or fail with some other error anyway.

> But yea, the new GWeakRef is probably what I want..

GWeakRef isn't what you want on its own - it isn't (necessarily)
heap-allocated, so you'd have to wrap it with e.g. g_new0 (GWeakRef) and
g_weak_ref_clear/g_free.

TpWeakRef is basically just a heap-allocated weak ref with a secondary
user_data pointer, designed to make it easy to implement our old weak_object
semantics in terms of GAsyncResult calls. Patches welcome to make it use
GWeakRef instead of g_object_add_weak_pointer, if you want to go that route.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- 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