[glib] resources: tests: Plug a mem leak
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] resources: tests: Plug a mem leak
- Date: Sun, 5 Feb 2012 18:58:09 +0000 (UTC)
commit 6789ab2294409ce9388ada1110ea5bb8da71b95a
Author: Christian Persch <chpe gnome org>
Date: Sun Feb 5 16:38:36 2012 +0100
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)
gio/tests/resources.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gio/tests/resources.c b/gio/tests/resources.c
index d18103d..9b8fdf1 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]