mapping-test: Add debug spew
[platform/upstream/glib.git] / tests / mainloop-test.c
index 14245b7..5d30550 100644 (file)
@@ -105,7 +105,7 @@ adder_callback (GIOChannel   *source,
   char buf1[32];
   char buf2[32];
 
-  char result[32];
+  char result[32] = { 0, };
 
   AddrData *addr_data = data;
 
@@ -190,6 +190,7 @@ adder_thread (gpointer data)
   g_mutex_unlock (&context_array_mutex);
 
   cleanup_crawlers (context);
+  g_main_context_unref (context);
 
   return NULL;
 }
@@ -215,8 +216,8 @@ io_pipe (GIOChannel **channels)
 static void
 do_add (GIOChannel *in, gint a, gint b)
 {
-  char buf1[32];
-  char buf2[32];
+  char buf1[32] = { 0, };
+  char buf2[32] = { 0, };
 
   sprintf (buf1, "%d", a);
   sprintf (buf2, "%d", b);
@@ -430,5 +431,8 @@ main (int   argc,
   g_main_loop_run (main_loop);
   g_main_loop_unref (main_loop);
 
+  g_ptr_array_unref (crawler_array);
+  g_ptr_array_unref (context_array);
+
   return 0;
 }