[gnio] Ensure that sources are freed



commit b4487409ede1e8b6d7682fa72a37aba687d4f11e
Author: Alexander Larsson <alexl redhat com>
Date:   Tue May 5 13:16:51 2009 +0200

    Ensure that sources are freed
    
    We need to unref the source after attaching it, otherwise it won't
    be freed when disconnected.
---
 test/server.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/test/server.c b/test/server.c
index a67dc9b..88e31e9 100644
--- a/test/server.c
+++ b/test/server.c
@@ -46,7 +46,7 @@ socket_address_to_string (GSocketAddress *address)
 
 static gboolean
 source_ready (gpointer data,
-	      GIOCondition        condition)
+	      GIOCondition condition)
 {
   g_main_loop_quit (loop);
   return FALSE;
@@ -72,6 +72,7 @@ ensure_condition (GSocket *socket,
                              (GSourceFunc) source_ready,
 			     NULL, NULL);
       g_source_attach (source, NULL);
+      g_source_unref (source);
       g_main_loop_run (loop);
     }
   else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]