[Bug 39189] [next] decide on a policy for transfer, naming and containers

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Sep 4 13:10:34 CEST 2012


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

--- Comment #20 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-09-04 11:10:34 UTC ---
(In reply to comment #16)
> Here is already a branch to remove _borrow_:
> http://cgit.collabora.com/git/user/xclaesse/telepathy-glib.git/log/?h=transfer

+ * tp_channel_dispatch_operation_get_channels: (skip)
+ * @self: a #TpChannelDispatchOperation
+ *
+ * Returns a #GPtrArray containing the #TpChannel of this
+ * ChannelDispatchOperation.
+ * The returned array and its #TpChannel are only valid while @self is
+ * valid - copy array and reference channels with g_object_ref() if needed.

They are actually only valid until the main loop is re-entered, because
channels can be lost. As a result, I would really prefer this one to become
some sort of _dup_ to "disconnect" it from the internal representation.

+ * tp_channel_get_immutable_properties:
...
+ * The returned hash table should not be altered, and is not necessarily
+ * valid after the main loop is next re-entered. Copy it with

This one has a lot of caveats:

* not usefully introspectable
* tied to dbus-glib
* caller must not alter it
* channel reserves the right to alter it
* copying it in a safe way (not just ref) involves g_boxed_copy

Can't we make the new recommended version return a (transfer full) ref to a
GVariant instead? (e.g. call dbus_g_value_build_g_variant() followed by
g_variant_ref_sink() - but I think we have a helper for this already)

-- 
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