diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-04-27 17:43:47 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-05-01 10:27:44 +0100 |
commit | f83071a7d8759ca70d6ffb19e3bd67d797deedf4 (patch) | |
tree | 78d45fc47ec9c6377902fd977630ffc23a75da7d /src/jingle-content.c | |
parent | d9ae717023dc5c8b8c488492c8e8c8984dc42ee6 (diff) | |
download | telepathy-gabble-f83071a7d8759ca70d6ffb19e3bd67d797deedf4.tar.gz |
Simplify gabble_jingle_session_send, fixing a leak
Previously, gabble_jingle_session_send passed the JingleSession as the
weak object to _gabble_connection_send_with_reply. This worked, but
meant that the jingle_reply_ctx was leaked for IQs that didn't return
before the session was terminated.
By removing some unused generality from the callbacks, the context
struct was removed completely. Now the weak object is supplied by the
caller; since only two callers actually use the IQ reply, this wasn't
invasive to fix.
Diffstat (limited to 'src/jingle-content.c')
-rw-r--r-- | src/jingle-content.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/jingle-content.c b/src/jingle-content.c index 3df57e382..56689dd62 100644 --- a/src/jingle-content.c +++ b/src/jingle-content.c @@ -959,17 +959,16 @@ gabble_jingle_content_change_direction (GabbleJingleContent *c, } static void -_on_remove_reply (GabbleJingleSession *sess, gboolean success, - LmMessage *reply, gpointer user_data) +_on_remove_reply (GObject *c_as_obj, + gboolean success, + LmMessage *reply) { - GabbleJingleContent *c = GABBLE_JINGLE_CONTENT (user_data); + GabbleJingleContent *c = GABBLE_JINGLE_CONTENT (c_as_obj); GabbleJingleContentPrivate *priv = c->priv; g_assert (priv->state == JINGLE_CONTENT_STATE_REMOVING); g_signal_emit (c, signals[REMOVED], 0); - - g_object_unref (c); } void @@ -1004,8 +1003,8 @@ gabble_jingle_content_remove (GabbleJingleContent *c, gboolean signal_peer) msg = gabble_jingle_session_new_message (c->session, JINGLE_ACTION_CONTENT_REMOVE, &sess_node); gabble_jingle_content_produce_node (c, sess_node, FALSE); - g_object_ref (c); - gabble_jingle_session_send (c->session, msg, _on_remove_reply, c); + gabble_jingle_session_send (c->session, msg, _on_remove_reply, + (GObject *) c); } else { |