[telepathy-gabble/master] MediaFactory: Remove unused session_chans map

Will Thompson will.thompson at collabora.co.uk
Mon Jun 29 10:44:49 PDT 2009


I guess this is left over from before the Jingle refactoring. Nothing
was ever added to session_chans, so this was all dead code.

Reviewed-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
---
 src/media-factory.c |   41 +----------------------------------------
 1 files changed, 1 insertions(+), 40 deletions(-)

diff --git a/src/media-factory.c b/src/media-factory.c
index 1b216b1..4d28d03 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -70,8 +70,6 @@ struct _GabbleMediaFactoryPrivate
   GPtrArray *channels;
   guint channel_index;
 
-  GHashTable *session_chans;
-
   gboolean dispose_has_run;
 };
 
@@ -88,9 +86,6 @@ gabble_media_factory_init (GabbleMediaFactory *fac)
 
   priv->conn = NULL;
   priv->dispose_has_run = FALSE;
-
-  priv->session_chans = g_hash_table_new_full (g_str_hash, g_str_equal,
-                                               g_free, NULL);
 }
 
 
@@ -112,17 +107,6 @@ gabble_media_factory_dispose (GObject *object)
   gabble_media_factory_close_all (fac);
   g_assert (priv->channels == NULL);
 
-  /* Use a temporary variable because we don't want
-   * media_channel_closed_cb to remove the channel from the hash table a
-   * second time */
-  if (priv->session_chans)
-    {
-      GHashTable *tmp = priv->session_chans;
-      priv->session_chans = NULL;
-      g_assert (g_hash_table_size (tmp) == 0);
-      g_hash_table_destroy (tmp);
-    }
-
   if (G_OBJECT_CLASS (gabble_media_factory_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_media_factory_parent_class)->dispose (object);
 }
@@ -192,22 +176,11 @@ gabble_media_factory_class_init (GabbleMediaFactoryClass *gabble_media_factory_c
 
 }
 
-static gboolean
-_remove_sid_mapping (gpointer key, gpointer value, gpointer user_data)
-{
-  GabbleMediaChannel *chan = GABBLE_MEDIA_CHANNEL (value);
-  GabbleMediaChannel *target_chan = GABBLE_MEDIA_CHANNEL (user_data);
-
-  if (chan == target_chan) return TRUE;
-  return FALSE;
-}
-
 /**
  * media_channel_closed_cb:
  *
  * Signal callback for when a media channel is closed. Removes the references
- * that #GabbleMediaFactory holds to them. Also removes all the sessions for
- * the closed channel.
+ * that #GabbleMediaFactory holds to them.
  */
 static void
 media_channel_closed_cb (GabbleMediaChannel *chan, gpointer user_data)
@@ -226,12 +199,6 @@ media_channel_closed_cb (GabbleMediaChannel *chan, gpointer user_data)
       g_ptr_array_remove (priv->channels, chan);
       g_object_unref (chan);
     }
-
-  if (priv->session_chans != NULL)
-    {
-      g_hash_table_foreach_remove (priv->session_chans, _remove_sid_mapping,
-          chan);
-    }
 }
 
 /**
@@ -309,12 +276,6 @@ gabble_media_factory_close_all (GabbleMediaFactory *fac)
       g_ptr_array_free (tmp, TRUE);
     }
 
-  if (priv->session_chans != NULL)
-    {
-      g_hash_table_destroy (priv->session_chans);
-      priv->session_chans = NULL;
-    }
-
   if (priv->status_changed_id != 0)
     {
       g_signal_handler_disconnect (priv->conn,
-- 
1.5.6.5




More information about the telepathy-commits mailing list