summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2011-01-20 14:13:29 +0200
committerPekka Pessi <Pekka.Pessi@nokia.com>2011-01-20 14:13:29 +0200
commit10c22855af18bd3e8d7733ba07ab5510b5dec5d2 (patch)
tree4cce8299a3c59f004572f5ed6a112f4dcde97ddc
parentb0a19b624ffb63e5cf6ddbba8a0d3d62bfa0622f (diff)
ring-text-manager: channels hash disposes channels
Ensure channels are disposed when they are removed.
-rw-r--r--src/ring-text-manager.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ring-text-manager.c b/src/ring-text-manager.c
index 12704fb..83739ee 100644
--- a/src/ring-text-manager.c
+++ b/src/ring-text-manager.c
@@ -122,6 +122,7 @@ static RingTextChannel *ring_text_manager_request(RingTextManager *self,
gboolean class0);
static void on_text_channel_closed(RingTextChannel *, RingTextManager *);
+static void text_channel_removed (gpointer _channel);
static void on_sms_service_deliver(ModemSMSService *,
SMSGDeliver *, gpointer _self);
@@ -163,8 +164,8 @@ ring_text_manager_init (RingTextManager *self)
self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self, RING_TYPE_TEXT_MANAGER,
RingTextManagerPrivate);
- self->priv->channels = g_hash_table_new_full(g_str_hash, g_str_equal,
- NULL, g_object_unref);
+ self->priv->channels = g_hash_table_new_full (g_str_hash, g_str_equal,
+ NULL, text_channel_removed);
}
static void
@@ -629,6 +630,14 @@ ring_text_manager_request(RingTextManager *self,
}
static void
+text_channel_removed (gpointer _channel)
+{
+ /* Ensure "closed" has been emitted */
+ g_object_run_dispose (_channel);
+ g_object_unref (_channel);
+}
+
+static void
on_text_channel_closed(RingTextChannel *channel, RingTextManager *self)
{
char *object_path;