2005-04-24 Mikael Hallendal <micke@imendio.com>
* loudmouth/lm-connection.c: (connection_free):
- Free the incoming message queue, reported by Daniel Lavalliere.
--- a/ChangeLog Sun Apr 24 11:40:16 2005 +0000
+++ b/ChangeLog Sun Apr 24 11:47:48 2005 +0000
@@ -1,3 +1,8 @@
+2005-04-24 Mikael Hallendal <micke@imendio.com>
+
+ * loudmouth/lm-connection.c: (connection_free):
+ - Free the incoming message queue, reported by Daniel Lavalliere.
+
2005-04-24 Mikael Hallendal <micke@imendio.com>
* loudmouth/lm-connection.c: (_lm_connection_succeeded),
--- a/loudmouth/lm-connection.c Sun Apr 24 11:40:16 2005 +0000
+++ b/loudmouth/lm-connection.c Sun Apr 24 11:47:48 2005 +0000
@@ -183,7 +183,8 @@
static void
connection_free (LmConnection *connection)
{
- int i;
+ int i;
+ LmMessage *m;
g_free (connection->server);
g_free (connection->jid);
@@ -203,11 +204,15 @@
}
g_hash_table_destroy (connection->id_handlers);
-
if (connection->state >= LM_CONNECTION_STATE_OPENING) {
connection_do_close (connection);
}
+ while ((m = g_queue_pop_head (connection->incoming_messages)) != NULL) {
+ lm_message_unref (m);
+ }
+
+ g_queue_free (connection->incoming_messages);
g_free (connection);
}