telepathy-idle: Stop refcounting handles, which have been "immortal" since 0.14
Simon McVittie
smcv at kemper.freedesktop.org
Wed May 30 05:08:43 PDT 2012
Module: telepathy-idle
Branch: master
Commit: 7dd61ce124bed7532ed84112ddda3c3d1387afb9
URL: http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=7dd61ce124bed7532ed84112ddda3c3d1387afb9
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Thu May 10 13:42:38 2012 +0100
Stop refcounting handles, which have been "immortal" since 0.14
Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Reviewed-by: Xavier Claessens <xavier.claessens at collabora.co.uk>
---
src/idle-connection.c | 2 --
src/idle-im-channel.c | 16 ----------------
src/idle-muc-channel.c | 3 ---
src/idle-parser.c | 2 --
4 files changed, 0 insertions(+), 23 deletions(-)
diff --git a/src/idle-connection.c b/src/idle-connection.c
index f18c2b3..382d8ae 100644
--- a/src/idle-connection.c
+++ b/src/idle-connection.c
@@ -1328,8 +1328,6 @@ static gboolean _send_rename_request(IdleConnection *obj, const gchar *nick, DBu
return FALSE;
}
- tp_handle_unref(handles, handle);
-
gchar msg[IRC_MSG_MAXLEN + 1];
g_snprintf(msg, IRC_MSG_MAXLEN + 1, "NICK %s", nick);
idle_connection_send(obj, msg);
diff --git a/src/idle-im-channel.c b/src/idle-im-channel.c
index 63a2116..6d144bd 100644
--- a/src/idle-im-channel.c
+++ b/src/idle-im-channel.c
@@ -101,7 +101,6 @@ static GObject *idle_im_channel_constructor(GType type, guint n_props, GObjectCo
GObject *obj;
IdleIMChannelPrivate *priv;
TpDBusDaemon *bus;
- TpHandleRepoIface *handles;
TpBaseConnection *conn;
TpChannelTextMessageType types[] = {
TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
@@ -118,9 +117,6 @@ static GObject *idle_im_channel_constructor(GType type, guint n_props, GObjectCo
conn = TP_BASE_CONNECTION(priv->connection);
- handles = tp_base_connection_get_handles(conn, TP_HANDLE_TYPE_CONTACT);
- tp_handle_ref(handles, priv->handle);
- tp_handle_ref(handles, priv->initiator);
g_assert(tp_handle_is_valid(tp_base_connection_get_handles(TP_BASE_CONNECTION(priv->connection), TP_HANDLE_TYPE_CONTACT), priv->handle, NULL));
bus = tp_base_connection_get_dbus_daemon (conn);
@@ -370,11 +366,6 @@ void idle_im_channel_dispose (GObject *object) {
void idle_im_channel_finalize (GObject *object) {
IdleIMChannel *self = IDLE_IM_CHANNEL(object);
IdleIMChannelPrivate *priv = IDLE_IM_CHANNEL_GET_PRIVATE(self);
- TpHandleRepoIface *handles;
-
- handles = tp_base_connection_get_handles(TP_BASE_CONNECTION(priv->connection), TP_HANDLE_TYPE_CONTACT);
- tp_handle_unref(handles, priv->handle);
- tp_handle_unref(handles, priv->initiator);
if (priv->object_path)
g_free(priv->object_path);
@@ -421,17 +412,10 @@ static void idle_im_channel_close (TpSvcChannel *iface, DBusGMethodInvocation *c
IDLE_DEBUG("Not really closing, I still have pending messages");
if (priv->initiator != priv->handle) {
- TpHandleRepoIface *contact_repo =
- tp_base_connection_get_handles(
- (TpBaseConnection *) priv->connection,
- TP_HANDLE_TYPE_CONTACT);
-
g_assert(priv->initiator != 0);
g_assert(priv->handle != 0);
- tp_handle_unref(contact_repo, priv->initiator);
priv->initiator = priv->handle;
- tp_handle_ref(contact_repo, priv->initiator);
}
tp_message_mixin_set_rescued ((GObject *) obj);
diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c
index 6b13df5..baa283a 100644
--- a/src/idle-muc-channel.c
+++ b/src/idle-muc-channel.c
@@ -1203,9 +1203,6 @@ void idle_muc_channel_mode(IdleMUCChannel *chan, GValueArray *args) {
IDLE_DEBUG("got MODE '%c' concerning us", *modes);
mode_accum |= _modechar_to_modeflag(*modes);
}
-
- if (handle)
- tp_handle_unref(handles, handle);
}
break;
diff --git a/src/idle-parser.c b/src/idle-parser.c
index 2d675cc..eb77086 100644
--- a/src/idle-parser.c
+++ b/src/idle-parser.c
@@ -514,12 +514,10 @@ static gboolean _parse_atom(IdleParser *parser, GValueArray *arr, char atom, con
if (atom == 'r') {
if ((handle = tp_handle_ensure(room_repo, id, NULL, NULL))) {
tp_handle_set_add(room_reffed, handle);
- tp_handle_unref(room_repo, handle);
}
} else {
if ((handle = tp_handle_ensure(contact_repo, id, NULL, NULL))) {
tp_handle_set_add(contact_reffed, handle);
- tp_handle_unref(contact_repo, handle);
idle_connection_canon_nick_receive(priv->conn, handle, id);
}
More information about the telepathy-commits
mailing list