2005-04-24 Mikael Hallendal <micke@imendio.com>
authorhallski <hallski>
Sun, 24 Apr 2005 11:47:48 +0000 (11:47 +0000)
committerhallski <hallski>
Sun, 24 Apr 2005 11:47:48 +0000 (11:47 +0000)
* loudmouth/lm-connection.c: (connection_free):
- Free the incoming message queue, reported by Daniel Lavalliere.

ChangeLog
loudmouth/lm-connection.c

index a92eb97eb2b671e37b4a3e3fc07e24b5bb124872..b7b93781116d4eff0a3179431629ba8c62e5a013 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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),
index f28df79e5724127ef98720e7d9220b77ce2cb7f1..01b1a69b3000c835ceb08edef6f4830a9423f6f7 100644 (file)
@@ -183,7 +183,8 @@ static GSourceFuncs incoming_funcs = {
 static void
 connection_free (LmConnection *connection)
 {
-       int i;
+       int        i;
+       LmMessage *m;
 
        g_free (connection->server);
        g_free (connection->jid);
@@ -203,11 +204,15 @@ connection_free (LmConnection *connection)
        }
 
        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);
 }