summaryrefslogtreecommitdiff
path: root/gio/gresource.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2012-02-05 16:37:36 +0100
committerChristian Persch <chpe@gnome.org>2012-02-05 19:57:10 +0100
commit877fe6fb524df8478c963342b7948aa3aa55f25e (patch)
treecea9466581bf3b1db0b2164d6e50a0c8dca48d08 /gio/gresource.c
parent30e9cccb85bd6f398ce1f17d9a8eae98f4c2430a (diff)
downloadglib-877fe6fb524df8478c963342b7948aa3aa55f25e.tar.gz
resources: Init refcount to 1
This bug was exposed by fixing the following leak in the resources test: ==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)
Diffstat (limited to 'gio/gresource.c')
-rw-r--r--gio/gresource.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gio/gresource.c b/gio/gresource.c
index c6175feae..338a2d264 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -251,6 +251,7 @@ g_resource_load (const gchar *filename,
return NULL;
resource = g_new0 (GResource, 1);
+ resource->ref_count = 1;
resource->table = table;
return resource;