From: Christian Persch Date: Sun, 5 Feb 2012 15:38:36 +0000 (+0100) Subject: resources: tests: Plug a mem leak X-Git-Tag: 2.31.18~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6789ab2294409ce9388ada1110ea5bb8da71b95a;p=platform%2Fupstream%2Fglib.git resources: tests: Plug a mem leak ==29204== 11,456 (84 direct, 11,372 indirect) bytes in 1 blocks are definitely lost in loss record 859 of 861 ==29204== at 0x402AD89: malloc (vg_replace_malloc.c:236) ==29204== by 0x4084724: standard_malloc (gmem.c:85) ==29204== by 0x40847C7: g_malloc (gmem.c:159) ==29204== by 0x409B1E1: g_slice_alloc (gslice.c:1003) ==29204== by 0x409B227: g_slice_alloc0 (gslice.c:1029) ==29204== by 0x41936CF: g_type_create_instance (gtype.c:1872) ==29204== by 0x417CCC9: g_object_constructor (gobject.c:1839) ==29204== by 0x417C6F4: g_object_newv (gobject.c:1703) ==29204== by 0x417CC5A: g_object_new_valist (gobject.c:1820) ==29204== by 0x417C1DB: g_object_new (gobject.c:1535) ==29204== by 0x41E5E29: g_converter_input_stream_new (gconverterinputstream.c:204) ==29204== by 0x4228D38: g_resource_open_stream (gresource.c:363) --- diff --git a/gio/tests/resources.c b/gio/tests/resources.c index d18103de0..9b8fdf1a5 100644 --- a/gio/tests/resources.c +++ b/gio/tests/resources.c @@ -93,7 +93,9 @@ test_resource (GResource *resource) buffer[size] = 0; g_assert_cmpstr (buffer, ==, "test1\n"); - g_input_stream_close (in, NULL, NULL); + g_input_stream_close (in, NULL, &error); + g_assert_no_error (error); + g_clear_object (&in); data = g_resource_lookup_data (resource, "/a_prefix/test2.txt", @@ -250,8 +252,9 @@ test_resource_registred (void) buffer[size] = 0; g_assert_cmpstr (buffer, ==, "test1\n"); - g_input_stream_close (in, NULL, NULL); - + g_input_stream_close (in, NULL, &error); + g_assert_no_error (error); + g_clear_object (&in); data = g_resources_lookup_data ("/a_prefix/test2.txt", G_RESOURCE_LOOKUP_FLAGS_NONE,