2005-04-24 Mikael Hallendal <micke@imendio.com>
authorhallski <hallski>
Sun, 24 Apr 2005 11:47:48 +0000
changeset 115 f2a921e232e5
parent 114 ebc113e63908
child 116 13c951a33aca
2005-04-24 Mikael Hallendal <micke@imendio.com> * loudmouth/lm-connection.c: (connection_free): - Free the incoming message queue, reported by Daniel Lavalliere.
ChangeLog
loudmouth/lm-connection.c
--- 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);
 }