summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2011-01-20 14:12:00 +0200
committerPekka Pessi <Pekka.Pessi@nokia.com>2011-01-20 14:12:00 +0200
commitb0a19b624ffb63e5cf6ddbba8a0d3d62bfa0622f (patch)
tree2f8e1981fd9ac38fbceeb4eb1092d992a7947e3d /src
parent97fecf72b67de9c6e38062d54c76644d63359177 (diff)
ring-text-channel: do not emit Closed twice
The channel destroy logic was twisted and emitted Closed twice.
Diffstat (limited to 'src')
-rw-r--r--src/ring-text-channel.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/ring-text-channel.c b/src/ring-text-channel.c
index 8bfeca0..c3f5dfc 100644
--- a/src/ring-text-channel.c
+++ b/src/ring-text-channel.c
@@ -96,7 +96,6 @@ struct _RingTextChannelPrivate
GQueue sending[1];
unsigned sms_flash:1; /* c.n.T.Channel.Interface.SMS.Flash */
- unsigned disposed:1;
unsigned :0;
};
@@ -105,7 +104,6 @@ struct _RingTextChannelPrivate
static void ring_text_base_channel_class_init (RingTextChannelClass *klass);
static void ring_text_channel_close (TpBaseChannel *base);
-static void ring_text_channel_destroy (RingTextChannel *self);
static void ring_text_channel_set_target_match(GValue *, char const *, int);
@@ -266,15 +264,12 @@ static void
ring_text_channel_dispose(GObject *object)
{
RingTextChannel *self = RING_TEXT_CHANNEL (object);
+ RingTextChannelPrivate *priv = self->priv;
- if (self->priv->disposed)
- return;
-
- self->priv->disposed = TRUE;
-
- ring_text_channel_destroy(self);
+ while (!g_queue_is_empty (priv->sending))
+ modem_request_cancel (g_queue_pop_head (priv->sending));
- ((GObjectClass *) ring_text_channel_parent_class)->dispose(object);
+ ((GObjectClass *)ring_text_channel_parent_class)->dispose (object);
}
static void
@@ -390,13 +385,8 @@ ring_text_base_channel_class_init (RingTextChannelClass *klass)
static void
ring_text_channel_destroy (RingTextChannel *self)
{
- RingTextChannelPrivate *priv = self->priv;
-
tp_message_mixin_clear ((gpointer)self);
- while (!g_queue_is_empty (priv->sending))
- modem_request_cancel (g_queue_pop_head (priv->sending));
-
ring_text_channel_close (TP_BASE_CHANNEL (self));
}