diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-05-10 14:59:46 +0200 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-05-10 15:13:24 +0200 |
commit | b7eaf004dd62f4425cc6027420533b493640d70d (patch) | |
tree | d32533c7cda33cdfd4e4a92b6f49be72f4c95422 | |
parent | 591ee25d44a016b38067d1f9a8772dca0fbca09c (diff) |
Stop using tp_handle_ref/unref
-rw-r--r-- | src/bytestream-factory.c | 5 | ||||
-rw-r--r-- | src/bytestream-ibb.c | 6 | ||||
-rw-r--r-- | src/bytestream-muc.c | 6 | ||||
-rw-r--r-- | src/bytestream-multiple.c | 6 | ||||
-rw-r--r-- | src/bytestream-socks5.c | 6 | ||||
-rw-r--r-- | src/capabilities.c | 2 | ||||
-rw-r--r-- | src/conn-addressing.c | 2 | ||||
-rw-r--r-- | src/conn-aliasing.c | 12 | ||||
-rw-r--r-- | src/conn-location.c | 5 | ||||
-rw-r--r-- | src/conn-olpc.c | 21 | ||||
-rw-r--r-- | src/media-channel.c | 22 | ||||
-rw-r--r-- | src/muc-channel.c | 24 | ||||
-rw-r--r-- | src/muc-factory.c | 17 | ||||
-rw-r--r-- | src/olpc-activity.c | 30 | ||||
-rw-r--r-- | src/presence-cache.c | 9 | ||||
-rw-r--r-- | src/roomlist-channel.c | 1 | ||||
-rw-r--r-- | src/roster.c | 33 | ||||
-rw-r--r-- | src/tube-dbus.c | 27 | ||||
-rw-r--r-- | src/tubes-channel.c | 27 | ||||
-rw-r--r-- | src/vcard-manager.c | 8 | ||||
-rw-r--r-- | tests/test-handles.c | 3 |
21 files changed, 6 insertions, 266 deletions
diff --git a/src/bytestream-factory.c b/src/bytestream-factory.c index 725f06e9f..ac1318fa3 100644 --- a/src/bytestream-factory.c +++ b/src/bytestream-factory.c @@ -1298,8 +1298,6 @@ out: g_slist_free (stream_methods); g_free (peer_resource); g_free (self_jid); - if (peer_handle != 0) - tp_handle_unref (contact_repo, peer_handle); return TRUE; } @@ -2146,9 +2144,6 @@ END: if (peer_resource != NULL) g_free (peer_resource); - if (peer_handle != 0) - tp_handle_unref (contact_repo, peer_handle); - g_free (self_jid); g_free (data->stream_id); g_slice_free (struct _streaminit_reply_cb_data, data); diff --git a/src/bytestream-ibb.c b/src/bytestream-ibb.c index bfa1b5641..e46e7339d 100644 --- a/src/bytestream-ibb.c +++ b/src/bytestream-ibb.c @@ -124,16 +124,12 @@ gabble_bytestream_ibb_dispose (GObject *object) { GabbleBytestreamIBB *self = GABBLE_BYTESTREAM_IBB (object); GabbleBytestreamIBBPrivate *priv = GABBLE_BYTESTREAM_IBB_GET_PRIVATE (self); - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; - tp_handle_unref (contact_repo, priv->peer_handle); - if (priv->state != GABBLE_BYTESTREAM_STATE_CLOSED) { gabble_bytestream_iface_close (GABBLE_BYTESTREAM_IFACE (self), NULL); @@ -285,8 +281,6 @@ gabble_bytestream_ibb_constructor (GType type, contact_repo = tp_base_connection_get_handles ( (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); - tp_handle_ref (contact_repo, priv->peer_handle); - jid = tp_handle_inspect (contact_repo, priv->peer_handle); if (priv->peer_resource != NULL) diff --git a/src/bytestream-muc.c b/src/bytestream-muc.c index 4a803bc58..82c555446 100644 --- a/src/bytestream-muc.c +++ b/src/bytestream-muc.c @@ -100,16 +100,12 @@ gabble_bytestream_muc_dispose (GObject *object) { GabbleBytestreamMuc *self = GABBLE_BYTESTREAM_MUC (object); GabbleBytestreamMucPrivate *priv = GABBLE_BYTESTREAM_MUC_GET_PRIVATE (self); - TpHandleRepoIface *room_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_ROOM); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; - tp_handle_unref (room_repo, priv->peer_handle); - if (priv->state != GABBLE_BYTESTREAM_STATE_CLOSED) { gabble_bytestream_iface_close (GABBLE_BYTESTREAM_IFACE (self), NULL); @@ -228,8 +224,6 @@ gabble_bytestream_muc_constructor (GType type, room_repo = tp_base_connection_get_handles ( (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_ROOM); - tp_handle_ref (room_repo, priv->peer_handle); - priv->peer_jid = tp_handle_inspect (room_repo, priv->peer_handle); diff --git a/src/bytestream-multiple.c b/src/bytestream-multiple.c index 07243e1f1..3890ecba9 100644 --- a/src/bytestream-multiple.c +++ b/src/bytestream-multiple.c @@ -100,16 +100,12 @@ gabble_bytestream_multiple_dispose (GObject *object) GabbleBytestreamMultiple *self = GABBLE_BYTESTREAM_MULTIPLE (object); GabbleBytestreamMultiplePrivate *priv = GABBLE_BYTESTREAM_MULTIPLE_GET_PRIVATE (self); - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; - tp_handle_unref (contact_repo, priv->peer_handle); - if (priv->state != GABBLE_BYTESTREAM_STATE_CLOSED) { gabble_bytestream_iface_close (GABBLE_BYTESTREAM_IFACE (self), NULL); @@ -263,8 +259,6 @@ gabble_bytestream_multiple_constructor (GType type, contact_repo = tp_base_connection_get_handles ( (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); - tp_handle_ref (contact_repo, priv->peer_handle); - jid = tp_handle_inspect (contact_repo, priv->peer_handle); if (priv->peer_resource != NULL) diff --git a/src/bytestream-socks5.c b/src/bytestream-socks5.c index 12bd7c509..75c2a6f5f 100644 --- a/src/bytestream-socks5.c +++ b/src/bytestream-socks5.c @@ -232,8 +232,6 @@ gabble_bytestream_socks5_dispose (GObject *object) GabbleBytestreamSocks5 *self = GABBLE_BYTESTREAM_SOCKS5 (object); GabbleBytestreamSocks5Private *priv = GABBLE_BYTESTREAM_SOCKS5_GET_PRIVATE (self); - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); if (priv->dispose_has_run) return; @@ -242,8 +240,6 @@ gabble_bytestream_socks5_dispose (GObject *object) stop_timer (self); - tp_handle_unref (contact_repo, priv->peer_handle); - if (priv->bytestream_state != GABBLE_BYTESTREAM_STATE_CLOSED) { gabble_bytestream_iface_close (GABBLE_BYTESTREAM_IFACE (self), NULL); @@ -398,8 +394,6 @@ gabble_bytestream_socks5_constructor (GType type, room_repo = tp_base_connection_get_handles (base_conn, TP_HANDLE_TYPE_ROOM); - tp_handle_ref (contact_repo, priv->peer_handle); - jid = tp_handle_inspect (contact_repo, priv->peer_handle); if (priv->peer_resource != NULL) diff --git a/src/capabilities.c b/src/capabilities.c index 620e3a6b4..03a6c146d 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -526,9 +526,7 @@ gabble_capability_set_add (GabbleCapabilitySet *caps, g_return_if_fail (cap != NULL); handle = tp_handle_ensure (feature_handles, cap, NULL, NULL); - tp_handle_set_add (caps->handles, handle); - tp_handle_unref (feature_handles, handle); } gboolean diff --git a/src/conn-addressing.c b/src/conn-addressing.c index 3edbac812..f70719b4f 100644 --- a/src/conn-addressing.c +++ b/src/conn-addressing.c @@ -102,7 +102,6 @@ conn_addressing_get_contacts_by_uri (GabbleSvcConnectionInterfaceAddressing *ifa gabble_svc_connection_interface_addressing_return_from_get_contacts_by_uri ( context, requested, attributes); - tp_handles_unref (contact_repo, handles); g_array_unref (handles); g_hash_table_unref (requested); g_hash_table_unref (attributes); @@ -143,7 +142,6 @@ conn_addressing_get_contacts_by_vcard_field (GabbleSvcConnectionInterfaceAddress gabble_svc_connection_interface_addressing_return_from_get_contacts_by_vcard_field ( context, requested, attributes); - tp_handles_unref (contact_repo, handles); g_array_unref (handles); g_hash_table_unref (requested); g_hash_table_unref (attributes); diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c index f48758eaf..748509bc4 100644 --- a/src/conn-aliasing.c +++ b/src/conn-aliasing.c @@ -103,7 +103,6 @@ aliases_request_new (GabbleConnection *conn, const GArray *contacts) { AliasesRequest *request; - TpHandleRepoIface *contact_handles; request = g_slice_new0 (AliasesRequest); request->conn = conn; @@ -116,10 +115,6 @@ aliases_request_new (GabbleConnection *conn, g_new0 (GabbleRequestPipelineItem *, contacts->len); request->aliases = g_new0 (gchar *, contacts->len + 1); - contact_handles = tp_base_connection_get_handles ((TpBaseConnection *) conn, - TP_HANDLE_TYPE_CONTACT); - tp_handles_ref (contact_handles, contacts); - return request; } @@ -128,7 +123,6 @@ static void aliases_request_free (AliasesRequest *request) { guint i; - TpHandleRepoIface *contact_handles; for (i = 0; i < request->contacts->len; i++) { @@ -138,10 +132,6 @@ aliases_request_free (AliasesRequest *request) request->vcard_requests[i]); } - contact_handles = tp_base_connection_get_handles ( - (TpBaseConnection *) request->conn, TP_HANDLE_TYPE_CONTACT); - tp_handles_unref (contact_handles, request->contacts); - g_array_unref (request->contacts); g_free (request->vcard_requests); g_free (request->pep_requests); @@ -341,7 +331,6 @@ pep_request_cb ( pep_request_ctx *ctx = user_data; ctx->callback (conn, msg, ctx->user_data, error); - tp_handle_unref (ctx->contact_handles, ctx->handle); g_slice_free (pep_request_ctx, ctx); } @@ -372,7 +361,6 @@ gabble_do_pep_request (GabbleConnection *self, ctx->contact_handles = contact_handles; ctx->handle = handle; - tp_handle_ref (contact_handles, handle); to = tp_handle_inspect (contact_handles, handle); msg = wocky_stanza_build (WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, to, diff --git a/src/conn-location.c b/src/conn-location.c index 81fd0b3ae..bb953832d 100644 --- a/src/conn-location.c +++ b/src/conn-location.c @@ -644,12 +644,9 @@ location_pep_node_changed (WockyPepService *pep, if (handle == base->self_handle) /* Ignore echoed pubsub notifications */ - goto out; + return; update_location_from_item (conn, handle, item_node); - -out: - tp_handle_unref (contact_repo, handle); } static void diff --git a/src/conn-olpc.c b/src/conn-olpc.c index 575c674c2..080b95902 100644 --- a/src/conn-olpc.c +++ b/src/conn-olpc.c @@ -495,7 +495,7 @@ olpc_buddy_props_pep_node_changed (WockyPepService *pep, if (handle == base->self_handle) /* Ignore echoed pubsub notifications */ - goto out; + return; node = search_for_child ( wocky_stanza_get_top_node (stanza), "properties", NULL); @@ -503,8 +503,6 @@ olpc_buddy_props_pep_node_changed (WockyPepService *pep, gabble_svc_olpc_buddy_info_emit_properties_changed (conn, handle, properties); g_hash_table_unref (properties); -out: - tp_handle_unref (contact_repo, handle); } static void @@ -710,7 +708,6 @@ extract_activities (GabbleConnection *conn, if (tp_handle_set_is_member (activities_set, room_handle)) { NODE_DEBUG (node, "Room advertised twice, skipping"); - tp_handle_unref (room_repo, room_handle); continue; } @@ -722,7 +719,6 @@ extract_activities (GabbleConnection *conn, } /* pass ownership to the activities_set */ tp_handle_set_add (activities_set, room_handle); - tp_handle_unref (room_repo, room_handle); if (tp_strdiff (activity->id, act_id)) { @@ -1307,8 +1303,6 @@ extract_current_activity (GabbleConnection *conn, conn->olpc_pep_activities); } - tp_handle_unref (room_repo, room_handle); - /* update current-activity cache */ if (activity != NULL) { @@ -1561,7 +1555,7 @@ olpc_current_act_pep_node_changed (WockyPepService *pep, if (handle == base->self_handle) /* Ignore echoed pubsub notifications */ - goto out; + return; node = search_for_child (wocky_stanza_get_top_node (stanza), "activity", NULL); @@ -1581,9 +1575,6 @@ olpc_current_act_pep_node_changed (WockyPepService *pep, gabble_svc_olpc_buddy_info_emit_current_activity_changed (conn, handle, "", 0); } - -out: - tp_handle_unref (contact_repo, handle); } static void @@ -2102,8 +2093,6 @@ update_activity_properties (GabbleConnection *conn, } } - tp_handle_unref (room_repo, room_handle); - if (activity == NULL) return; @@ -2186,11 +2175,9 @@ olpc_act_props_pep_node_changed (WockyPepService *pep, if (handle == base->self_handle) /* Ignore echoed pubsub notifications */ - goto out; + return; update_activities_properties (conn, jid, stanza); -out: - tp_handle_unref (contact_repo, handle); } static void @@ -2373,7 +2360,6 @@ conn_olpc_process_activity_properties_message (GabbleConnection *conn, g_object_ref (activity); tp_handle_set_add (their_invites, room_handle); } - tp_handle_unref (room_repo, room_handle); } else { @@ -2734,7 +2720,6 @@ muc_channel_pre_invite_cb (GabbleMucChannel *chan, } tp_handle_set_add (invitees, handle); - tp_handle_unref (contact_repo, handle); g_object_unref (conn); } diff --git a/src/media-channel.c b/src/media-channel.c index f4f15d42c..386c71fe2 100644 --- a/src/media-channel.c +++ b/src/media-channel.c @@ -366,7 +366,6 @@ gabble_media_channel_constructor (GType type, guint n_props, /* automatically add creator to channel, but also ref them again (because * priv->creator is the InitiatorHandle) */ g_assert (priv->creator != 0); - tp_handle_ref (contact_handles, priv->creator); set = tp_intset_new_containing (priv->creator); tp_group_mixin_change_members (obj, "", set, NULL, NULL, NULL, 0, @@ -666,15 +665,6 @@ gabble_media_channel_set_property (GObject *object, break; case PROP_INITIAL_PEER: priv->initial_peer = g_value_get_uint (value); - - if (priv->initial_peer != 0) - { - TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn; - TpHandleRepoIface *repo = tp_base_connection_get_handles (base_conn, - TP_HANDLE_TYPE_CONTACT); - tp_handle_ref (repo, priv->initial_peer); - } - break; case PROP_PEER_IN_RP: priv->peer_in_rp = g_value_get_boolean (value); @@ -952,9 +942,6 @@ gabble_media_channel_dispose (GObject *object) { GabbleMediaChannel *self = GABBLE_MEDIA_CHANNEL (object); GabbleMediaChannelPrivate *priv = self->priv; - TpBaseConnection *conn = (TpBaseConnection *) priv->conn; - TpHandleRepoIface *contact_handles = tp_base_connection_get_handles ( - conn, TP_HANDLE_TYPE_CONTACT); GList *l; if (priv->dispose_has_run) @@ -990,15 +977,6 @@ gabble_media_channel_dispose (GObject *object) priv->delayed_request_streams = NULL; } - tp_handle_unref (contact_handles, priv->creator); - priv->creator = 0; - - if (priv->initial_peer != 0) - { - tp_handle_unref (contact_handles, priv->initial_peer); - priv->initial_peer = 0; - } - /* All of the streams should have closed in response to the contents being * removed when the call ended. */ diff --git a/src/muc-channel.c b/src/muc-channel.c index 0a507f916..33bc04bd8 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -528,8 +528,6 @@ gabble_muc_channel_constructed (GObject *obj) g_assert (error == NULL); g_array_unref (members); } - - tp_handle_unref (contact_handles, self_handle); } typedef struct { @@ -1605,7 +1603,6 @@ handle_nick_conflict (GabbleMucChannel *chan, tp_intset_destroy (add_rp); tp_intset_destroy (remove_rp); - tp_handle_unref (contact_repo, self_handle); priv->nick_retry_count++; send_join_request (chan); @@ -2008,10 +2005,7 @@ handle_parted (GObject *source, close_channel (gmuc, why, FALSE, actor, reason); - if (actor != 0) - tp_handle_unref (contact_repo, actor); tp_intset_destroy (handles); - tp_handle_unref (contact_repo, member); } @@ -2068,10 +2062,7 @@ handle_left (GObject *source, tp_message_mixin_change_chat_state (data, member, TP_CHANNEL_CHAT_STATE_GONE); - if (actor != 0) - tp_handle_unref (contact_repo, actor); tp_intset_destroy (handles); - tp_handle_unref (contact_repo, member); } /* connect to wocky-muc:SIG_PERM_CHANGE, which we will receive when the * @@ -2162,8 +2153,6 @@ handle_renamed (GObject *source, handle_tube_presence (gmuc, myself, stanza); tp_intset_destroy (old_self); - tp_handle_unref (contact_repo, userid); - tp_handle_unref (contact_repo, myself); } static void @@ -2199,7 +2188,6 @@ update_roster_presence (GabbleMucChannel *gmuc, GUINT_TO_POINTER (handle), GUINT_TO_POINTER (owner)); - tp_handle_unref (contact_repo, handle); /* make a note of the fact that owner JIDs are visible to us */ /* notify whomever that an identifiable contact joined the MUC */ if (owner != 0) @@ -2207,7 +2195,6 @@ update_roster_presence (GabbleMucChannel *gmuc, tp_group_mixin_change_flags (G_OBJECT (gmuc), 0, TP_CHANNEL_GROUP_FLAG_HANDLE_OWNERS_NOT_AVAILABLE); g_signal_emit (gmuc, signals[CONTACT_JOIN], 0, owner); - tp_handle_unref (contact_repo, owner); } handle_tube_presence (gmuc, handle, member->presence_stanza); @@ -2271,7 +2258,6 @@ handle_join (WockyMuc *muc, g_object_set (gmuc, "state", MUC_STATE_JOINED, NULL); - tp_handle_unref (contact_repo, myself); tp_handle_set_destroy (members); tp_handle_set_destroy (owners); g_hash_table_unref (omap); @@ -2346,10 +2332,6 @@ handle_presence (GObject *source, } #endif - /* zap the handle refs we created */ - tp_handle_unref (contact_repo, handle); - if (owner != 0) - tp_handle_unref (contact_repo, owner); tp_handle_set_destroy (handles); } @@ -2396,7 +2378,6 @@ handle_message (GObject *source, handle_type = TP_HANDLE_TYPE_ROOM; repo = tp_base_connection_get_handles (conn, handle_type); from = tp_base_channel_get_target_handle (base); - tp_handle_ref (repo, from); } switch (type) @@ -2443,8 +2424,6 @@ handle_message (GObject *source, if (subject != NULL) _gabble_muc_channel_handle_subject (gmuc, handle_type, from, datetime, subject, stanza); - - tp_handle_unref (repo, from); } static void @@ -2489,7 +2468,6 @@ handle_errmsg (GObject *source, handle_type = TP_HANDLE_TYPE_ROOM; repo = tp_base_connection_get_handles (conn, handle_type); from = tp_base_channel_get_target_handle (base); - tp_handle_ref (repo, from); } tp_err = gabble_tp_send_error_from_wocky_xmpp_error (error); @@ -2518,8 +2496,6 @@ handle_errmsg (GObject *source, !tp_strdiff (xmpp_id, priv->set_subject_stanza_id))) _gabble_muc_channel_handle_subject (gmuc, handle_type, from, datetime, subject, stanza); - - tp_handle_unref (repo, from); } /* ************************************************************************* */ diff --git a/src/muc-factory.c b/src/muc-factory.c index c208c2dff..ab1de5bd9 100644 --- a/src/muc-factory.c +++ b/src/muc-factory.c @@ -555,8 +555,6 @@ do_invite (GabbleMucFactory *fac, { DEBUG ("ignoring invite to room \"%s\"; we're already there", room); } - - tp_handle_unref (room_repo, room_handle); } struct DiscoInviteData { @@ -584,8 +582,6 @@ obsolete_invite_disco_cb (GabbleDisco *self, GabbleMucFactory *fac = GABBLE_MUC_FACTORY (data->factory); GabbleMucFactoryPrivate *priv = fac->priv; - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); WockyNode *identity; const char *category = NULL, *type = NULL; @@ -617,7 +613,6 @@ obsolete_invite_disco_cb (GabbleDisco *self, do_invite (fac, jid, data->inviter, data->reason); out: - tp_handle_unref (contact_repo, data->inviter); g_free (data->reason); g_slice_free (struct DiscoInviteData, data); } @@ -690,8 +685,6 @@ process_muc_invite (GabbleMucFactory *fac, do_invite (fac, room, inviter_handle, reason); g_free (room); - tp_handle_unref (contact_repo, inviter_handle); - return TRUE; } @@ -769,7 +762,6 @@ process_obsolete_invite (GabbleMucFactory *fac, { DEBUG ("obsolete MUC invite disco failed, freeing info"); - tp_handle_unref (contact_repo, inviter_handle); g_free (disco_udata->reason); g_slice_free (struct DiscoInviteData, disco_udata); } @@ -1340,7 +1332,6 @@ handle_text_channel_request (GabbleMucFactory *self, } tp_handle_set_add (handles, handle); - tp_handle_unref (contact_handles, handle); } } @@ -1415,11 +1406,6 @@ handle_text_channel_request (GabbleMucFactory *self, goto out; } } - else - { - /* ref room here so we can unref it again, below */ - tp_handle_ref (room_handles, room); - } /* Make sure TargetID and RoomName don't conflict. */ if (room_name != NULL && room_name[0] != '\0') @@ -1543,9 +1529,6 @@ handle_text_channel_request (GabbleMucFactory *self, } out: - if (room != 0) - tp_handle_unref (room_handles, room); - g_hash_table_unref (final_channels); g_array_unref (final_handles); g_free (final_ids); diff --git a/src/olpc-activity.c b/src/olpc-activity.c index 7d8028e6d..86df324e8 100644 --- a/src/olpc-activity.c +++ b/src/olpc-activity.c @@ -63,26 +63,6 @@ gabble_olpc_activity_init (GabbleOlpcActivity *self) } static void -gabble_olpc_activity_dispose (GObject *object) -{ - GabbleOlpcActivity *self = GABBLE_OLPC_ACTIVITY (object); - GabbleOlpcActivityPrivate *priv = self->priv; - TpHandleRepoIface *room_repo; - - if (priv->dispose_has_run) - return; - - room_repo = tp_base_connection_get_handles ((TpBaseConnection *) priv->conn, - TP_HANDLE_TYPE_ROOM); - tp_handle_unref (room_repo, self->room); - - priv->dispose_has_run = TRUE; - - if (G_OBJECT_CLASS (gabble_olpc_activity_parent_class)->dispose) - G_OBJECT_CLASS (gabble_olpc_activity_parent_class)->dispose (object); -} - -static void gabble_olpc_activity_finalize (GObject *object) { GabbleOlpcActivity *self = GABBLE_OLPC_ACTIVITY (object); @@ -171,23 +151,14 @@ gabble_olpc_activity_constructor (GType type, { GObject *obj; GabbleOlpcActivity *self; - GabbleOlpcActivityPrivate *priv; - TpHandleRepoIface *room_repo; obj = G_OBJECT_CLASS (gabble_olpc_activity_parent_class)-> constructor (type, n_props, props); self = GABBLE_OLPC_ACTIVITY (obj); - priv = self->priv; - - room_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, - TP_HANDLE_TYPE_ROOM); g_assert (self->room != 0); - tp_handle_ref (room_repo, self->room); - DEBUG ("new activity %s (%d)", gabble_olpc_activity_get_room (self), self->room); @@ -208,7 +179,6 @@ gabble_olpc_activity_class_init ( g_type_class_add_private (gabble_olpc_activity_class, sizeof (GabbleOlpcActivityPrivate)); - object_class->dispose = gabble_olpc_activity_dispose; object_class->finalize = gabble_olpc_activity_finalize; param_spec = g_param_spec_object ( diff --git a/src/presence-cache.c b/src/presence-cache.c index 22e025c27..7cb0a3fe0 100644 --- a/src/presence-cache.c +++ b/src/presence-cache.c @@ -147,7 +147,6 @@ disco_waiter_new (TpHandleRepoIface *repo, DiscoWaiter *waiter; g_assert (repo); - tp_handle_ref (repo, handle); waiter = g_slice_new0 (DiscoWaiter); waiter->repo = repo; @@ -171,8 +170,6 @@ disco_waiter_free (DiscoWaiter *waiter) DEBUG ("freeing waiter %p for handle %u with serial %u", waiter, waiter->handle, waiter->serial); - tp_handle_unref (waiter->repo, waiter->handle); - g_free (waiter->resource); g_free (waiter->hash); g_free (waiter->ver); @@ -1348,7 +1345,7 @@ _caps_disco_cb (GabbleDisco *disco, if (NULL == waiter_self) { DEBUG ("Ignoring non requested disco reply from %s", jid); - goto OUT; + return; } /* Now onto caps */ @@ -1490,10 +1487,6 @@ _caps_disco_cb (GabbleDisco *disco, gabble_capability_set_free (cap_set); g_ptr_array_unref (data_forms); - -OUT: - if (handle) - tp_handle_unref (contact_repo, handle); } static void diff --git a/src/roomlist-channel.c b/src/roomlist-channel.c index 642c983d1..9109db19e 100644 --- a/src/roomlist-channel.c +++ b/src/roomlist-channel.c @@ -415,7 +415,6 @@ room_info_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data) /* transfer the room handle ref to signalled_rooms */ tp_handle_set_add (priv->signalled_rooms, handle); - tp_handle_unref (room_handles, handle); g_value_init (&room, room_info_type); g_value_take_boxed (&room, diff --git a/src/roster.c b/src/roster.c index d77adb147..975b56697 100644 --- a/src/roster.c +++ b/src/roster.c @@ -214,17 +214,6 @@ gabble_roster_dispose (GObject *object) } static void -item_handle_unref_foreach (gpointer key, gpointer data, gpointer user_data) -{ - TpHandle handle = GPOINTER_TO_UINT (key); - GabbleRosterPrivate *priv = (GabbleRosterPrivate *) user_data; - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); - - tp_handle_unref (contact_repo, handle); -} - -static void gabble_roster_finalize (GObject *object) { GabbleRoster *self = GABBLE_ROSTER (object); @@ -232,7 +221,6 @@ gabble_roster_finalize (GObject *object) DEBUG ("called with %p", object); - g_hash_table_foreach (priv->items, item_handle_unref_foreach, priv); g_hash_table_unref (priv->items); G_OBJECT_CLASS (gabble_roster_parent_class)->finalize (object); @@ -323,7 +311,6 @@ _parse_item_groups (WockyNode *item_node, TpBaseConnection *conn) if (!handle) continue; tp_handle_set_add (groups, handle); - tp_handle_unref (group_repo, handle); } return groups; @@ -459,7 +446,6 @@ _gabble_roster_item_ensure (GabbleRoster *roster, item->publish = TP_SUBSCRIPTION_STATE_NO; item->name = alias; item->groups = tp_handle_set_new (group_repo); - tp_handle_ref (contact_repo, handle); g_hash_table_insert (priv->items, GUINT_TO_POINTER (handle), item); } @@ -512,7 +498,6 @@ _gabble_roster_item_maybe_remove (GabbleRoster *roster, DEBUG ("removing contact#%u", handle); item = NULL; g_hash_table_remove (priv->items, GUINT_TO_POINTER (handle)); - tp_handle_unref (contact_repo, handle); return TRUE; } @@ -1113,7 +1098,6 @@ process_roster ( /* transfer ownership of the reference to referenced_handles */ tp_handle_set_add (referenced_handles, handle); - tp_handle_unref (contact_repo, handle); item = _gabble_roster_item_update (roster, handle, item_node, google_roster, &nickname_updated); @@ -1551,8 +1535,7 @@ gabble_roster_presence_cb (WockyPorter *porter, { NODE_DEBUG (pres_node, "ignoring presence from ourselves on another " "resource"); - ret = FALSE; - goto OUT; + return FALSE; } g_assert (handle != 0); @@ -1679,8 +1662,6 @@ gabble_roster_presence_cb (WockyPorter *porter, ret = FALSE; } -OUT: - tp_handle_unref (contact_repo, handle); return ret; } @@ -1880,7 +1861,6 @@ item_edit_new (TpHandleRepoIface *contact_repo, { GabbleRosterItemEdit *self = g_slice_new0 (GabbleRosterItemEdit); - tp_handle_ref (contact_repo, handle); self->contact_repo = g_object_ref (contact_repo); self->handle = handle; self->new_subscription = GABBLE_ROSTER_SUBSCRIPTION_INVALID; @@ -1906,7 +1886,6 @@ item_edit_free (GabbleRosterItemEdit *edits) g_slist_free (edits->results); - tp_handle_unref (edits->contact_repo, edits->handle); g_object_unref (edits->contact_repo); tp_clear_pointer (&edits->add_to_groups, tp_handle_set_destroy); tp_clear_pointer (&edits->remove_from_groups, tp_handle_set_destroy); @@ -3218,7 +3197,6 @@ gabble_roster_set_contact_groups_async (TpBaseContactList *base, g_ptr_array_add (groups_created, (gchar *) groups[i]); } - tp_handle_unref (group_repo, group_handle); } if (groups_created->len > 0) @@ -3300,8 +3278,6 @@ gabble_roster_set_group_members_async (TpBaseContactList *base, result); } - tp_handle_unref (group_repo, group_handle); - finally: gabble_simple_async_countdown_dec (result); g_object_unref (result); @@ -3348,8 +3324,6 @@ gabble_roster_add_to_group_async (TpBaseContactList *base, gabble_roster_handle_add_to_group (self, contact, group_handle, result); } - tp_handle_unref (group_repo, group_handle); - finally: gabble_simple_async_countdown_dec (result); g_object_unref (result); @@ -3464,8 +3438,6 @@ gabble_roster_remove_group_removed_cb (GObject *source, DEBUG ("contact #%u is still a member of group '%s', not removing", remaining_member, group); } - - tp_handle_unref (group_repo, context->group_handle); } context->callback (source, result, context->user_data); @@ -3495,9 +3467,6 @@ gabble_roster_remove_group_async (TpBaseContactList *base, context->user_data = user_data; context->contacts = tp_handle_set_new (contact_repo); - if (context->group_handle != 0) - tp_handle_ref (group_repo, context->group_handle); - result = gabble_simple_async_countdown_new (self, gabble_roster_remove_group_removed_cb, context, gabble_roster_remove_group_async, 1); diff --git a/src/tube-dbus.c b/src/tube-dbus.c index ebe26f481..d7f06bba9 100644 --- a/src/tube-dbus.c +++ b/src/tube-dbus.c @@ -435,17 +435,6 @@ gabble_tube_dbus_init (GabbleTubeDBus *self) self->priv = priv; } -static void -unref_handle_foreach (gpointer key, - gpointer value, - gpointer user_data) -{ - TpHandle handle = GPOINTER_TO_UINT (key); - TpHandleRepoIface *contact_repo = (TpHandleRepoIface *) user_data; - - tp_handle_unref (contact_repo, handle); -} - static TpTubeChannelState get_tube_state (GabbleTubeDBus *self) { @@ -507,10 +496,6 @@ gabble_tube_dbus_dispose (GObject *object) { GabbleTubeDBus *self = GABBLE_TUBE_DBUS (object); GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self); - TpBaseConnection *base_conn = tp_base_channel_get_connection ( - TP_BASE_CHANNEL (self)); - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - base_conn, TP_HANDLE_TYPE_CONTACT); DEBUG ("called"); @@ -556,13 +541,6 @@ gabble_tube_dbus_dispose (GObject *object) tp_clear_pointer (&priv->dbus_srv_addr, g_free); tp_clear_pointer (&priv->socket_path, g_free); tp_clear_pointer (&priv->dbus_local_name, g_free); - - if (priv->dbus_names != NULL) - { - g_hash_table_foreach (priv->dbus_names, unref_handle_foreach, - contact_repo); - } - tp_clear_pointer (&priv->dbus_names, g_hash_table_unref); tp_clear_pointer (&priv->dbus_name_to_handle, g_hash_table_unref); @@ -1518,7 +1496,6 @@ gabble_tube_dbus_add_name (GabbleTubeDBus *self, name_copy = g_strdup (name); g_hash_table_insert (priv->dbus_names, GUINT_TO_POINTER (handle), name_copy); - tp_handle_ref (contact_repo, handle); g_hash_table_insert (priv->dbus_name_to_handle, name_copy, GUINT_TO_POINTER (handle)); @@ -1545,9 +1522,6 @@ gabble_tube_dbus_remove_name (GabbleTubeDBus *self, GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self); TpBaseChannel *base = TP_BASE_CHANNEL (self); TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base); - TpBaseConnection *base_conn = tp_base_channel_get_connection (base); - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - base_conn, TP_HANDLE_TYPE_CONTACT); const gchar *name; GHashTable *added; GArray *removed; @@ -1575,7 +1549,6 @@ gabble_tube_dbus_remove_name (GabbleTubeDBus *self, g_hash_table_unref (added); g_array_unref (removed); - tp_handle_unref (contact_repo, handle); return TRUE; } diff --git a/src/tubes-channel.c b/src/tubes-channel.c index bc16463c9..5620ff060 100644 --- a/src/tubes-channel.c +++ b/src/tubes-channel.c @@ -144,7 +144,6 @@ gabble_tubes_channel_constructor (GType type, GabbleTubesChannel *self; GabbleTubesChannelPrivate *priv; TpDBusDaemon *bus; - TpHandleRepoIface *handle_repo, *contact_repo; DEBUG ("Called"); @@ -153,15 +152,6 @@ gabble_tubes_channel_constructor (GType type, self = GABBLE_TUBES_CHANNEL (obj); priv = self->priv; - contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); - handle_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, priv->handle_type); - - tp_handle_ref (handle_repo, priv->handle); - - if (priv->initiator != 0) - tp_handle_ref (contact_repo, priv->initiator); switch (priv->handle_type) { @@ -815,8 +805,6 @@ gabble_tubes_channel_presence_updated (GabbleTubesChannel *self, { GabbleTubesChannelPrivate *priv = self->priv; WockyNode *tubes_node; - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); WockyNodeIter i; WockyNode *tube_node; const gchar *presence_type; @@ -892,12 +880,7 @@ gabble_tubes_channel_presence_updated (GabbleTubesChannel *self, break; case TP_TUBE_TYPE_STREAM: { - if (initiator_handle != 0) - /* ignore it */ - tp_handle_unref (contact_repo, initiator_handle); - initiator_handle = contact; - tp_handle_ref (contact_repo, initiator_handle); } break; default: @@ -913,7 +896,6 @@ gabble_tubes_channel_presence_updated (GabbleTubesChannel *self, TP_EXPORTABLE_CHANNEL (tube), NULL); /* the tube has reffed its initiator, no need to keep a ref */ - tp_handle_unref (contact_repo, initiator_handle); g_hash_table_unref (parameters); } } @@ -2319,16 +2301,12 @@ gabble_tubes_channel_dispose (GObject *object) { GabbleTubesChannel *self = GABBLE_TUBES_CHANNEL (object); GabbleTubesChannelPrivate *priv = self->priv; - TpHandleRepoIface *handle_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, priv->handle_type); if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; - tp_handle_unref (handle_repo, priv->handle); - if (self->muc != NULL) { g_signal_handler_disconnect (self->muc, priv->pre_presence_signal); @@ -2349,14 +2327,9 @@ gabble_tubes_channel_finalize (GObject *object) { GabbleTubesChannel *self = GABBLE_TUBES_CHANNEL (object); GabbleTubesChannelPrivate *priv = self->priv; - TpHandleRepoIface *contact_handles = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT); g_free (priv->object_path); - if (priv->initiator != 0) - tp_handle_unref (contact_handles, priv->initiator); - G_OBJECT_CLASS (gabble_tubes_channel_parent_class)->finalize (object); } diff --git a/src/vcard-manager.c b/src/vcard-manager.c index 54b5529a6..d52fd1eaa 100644 --- a/src/vcard-manager.c +++ b/src/vcard-manager.c @@ -403,9 +403,6 @@ static void cache_entry_free (gpointer data) { GabbleVCardCacheEntry *entry = data; - GabbleVCardManagerPrivate *priv = entry->manager->priv; - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles - ((TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT); g_assert (entry != NULL); @@ -421,8 +418,6 @@ cache_entry_free (gpointer data) tp_clear_pointer (&entry->vcard_node, wocky_node_free); - tp_handle_unref (contact_repo, entry->handle); - g_slice_free (GabbleVCardCacheEntry, entry); } @@ -430,8 +425,6 @@ static GabbleVCardCacheEntry * cache_entry_get (GabbleVCardManager *manager, TpHandle handle) { GabbleVCardManagerPrivate *priv = manager->priv; - TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( - (TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT); GabbleVCardCacheEntry *entry; entry = g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (handle)); @@ -442,7 +435,6 @@ cache_entry_get (GabbleVCardManager *manager, TpHandle handle) entry->manager = manager; entry->handle = handle; - tp_handle_ref (contact_repo, handle); g_hash_table_insert (priv->cache, GUINT_TO_POINTER (handle), entry); return entry; diff --git a/tests/test-handles.c b/tests/test-handles.c index 7439a6882..46d28aa84 100644 --- a/tests/test-handles.c +++ b/tests/test-handles.c @@ -65,9 +65,6 @@ test_handles (guint handle_type) return_jid = tp_handle_inspect (tp_repo, handle); g_assert (!strcmp (return_jid, jid)); - /* Now unref it */ - tp_handle_unref (tp_repo, handle); - for (i = 0; i < NUM_TP_HANDLE_TYPES; i++) { if (repos[i]) |