summaryrefslogtreecommitdiff
path: root/telepathy-glib/connection-handles.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-10-07 17:18:30 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2008-10-13 12:57:36 +0100
commit90fc47a040242d1ada4f34c1ae3e44947ecafa5c (patch)
treea621d5687084ade1ad3497bc54b85478deb8bb26 /telepathy-glib/connection-handles.c
parent7fbbf2a8c8939c9f207d2da092ff72e38bfc6bcf (diff)
downloadtelepathy-glib-90fc47a040242d1ada4f34c1ae3e44947ecafa5c.tar.gz
tp_connection_unref_handles: add more checks, and document that it's a no-op on invalidated connections
Diffstat (limited to 'telepathy-glib/connection-handles.c')
-rw-r--r--telepathy-glib/connection-handles.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c
index dfa7dd2d4..11cda5750 100644
--- a/telepathy-glib/connection-handles.c
+++ b/telepathy-glib/connection-handles.c
@@ -273,6 +273,8 @@ _tp_connection_clean_up_handle_refs (TpConnection *self)
*
* Release the reference to the handles in @handles that was obtained by
* calling tp_connection_hold_handles() or tp_connection_request_handles().
+ *
+ * If @self has already become invalid, this function does nothing.
*/
void
tp_connection_unref_handles (TpConnection *self,
@@ -290,13 +292,15 @@ tp_connection_unref_handles (TpConnection *self,
DEBUG ("%p: %u handles of type %u", self, n_handles, handle_type);
+ g_return_if_fail (TP_IS_CONNECTION (self));
+ g_return_if_fail (handle_type > TP_HANDLE_TYPE_NONE);
+ g_return_if_fail (handle_type < NUM_TP_HANDLE_TYPES);
+
if (as_proxy->invalidated != NULL)
{
return;
}
- g_return_if_fail (handle_type < NUM_TP_HANDLE_TYPES);
-
/* MT: libdbus protects us, if so configured */
if (!dbus_connection_allocate_data_slot (&connection_handle_refs_slot))
oom ();