Plug a mem leak in contexts test
authorChristian Persch <chpe@gnome.org>
Fri, 3 Sep 2010 20:00:15 +0000 (16:00 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 3 Sep 2010 20:00:15 +0000 (16:00 -0400)
==14059== 96 bytes in 2 blocks are definitely lost in loss record 520 of 543
==14059==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==14059==    by 0x4057094: g_malloc (gmem.c:134)
==14059==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==14059==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==14059==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==14059==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==14059==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==14059==    by 0x411DB93: g_object_new (gobject.c:1178)
==14059==    by 0x42296AF: _g_local_file_input_stream_new (glocalfileinputstream.c:152)
==14059==    by 0x422281F: g_local_file_read (glocalfile.c:1322)
==14059==    by 0x418A8A9: open_read_async_thread (gfile.c:5050)
==14059==    by 0x41B71BB: run_in_thread (gsimpleasyncresult.c:853)
==14059==    by 0x41A5FBC: io_job_thread (gioscheduler.c:181)
==14059==    by 0x407DCDE: g_thread_pool_thread_proxy (gthreadpool.c:314)
==14059==    by 0x407C6B0: g_thread_create_proxy (gthread.c:1897)
==14059==    by 0x57D918: start_thread (pthread_create.c:301)
==14059==    by 0x4C6CBD: clone (clone.S:133)

Bug #628331.

gio/tests/contexts.c

index 5a27c56..5ddb54f 100644 (file)
@@ -39,6 +39,8 @@ opened_for_read (GObject *source, GAsyncResult *result, gpointer loop)
                             async_read_buffer, sizeof (async_read_buffer),
                             G_PRIORITY_DEFAULT, NULL,
                             read_data, loop);
+
+  g_object_unref (in);
 }
 
 /* Test 1: Async I/O started in a thread with a thread-default context