valgrind reports memory leak on g_main_loop_run
- From: Sune Ahlgren <sune_ahlgren hotmail com>
- To: glib <gtk-app-devel-list gnome org>
- Subject: valgrind reports memory leak on g_main_loop_run
- Date: Wed, 17 Dec 2008 11:00:47 +0100
Hi,
I use 1 GMain event loop in my main context for monitoring of events on file descriptors. I shut down my
program by receiving a SIGTERM. In this signal handler I do the following:
g_main_loop_quit(loop); g_main_loop_unref(loop); loop = NULL;
I've also tried to move:
g_main_loop_unref(loop); loop = NULL;to the very end of my main function. I still get:
==6087== 744 bytes in 3 blocks are possibly lost in loss record 7 of 9==6087== at 0x4021C8A: memalign
(vg_replace_malloc.c:460)==6087== by 0x4021D3E: posix_memalign (vg_replace_malloc.c:569)==6087== by
0x409391E: (within /usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x40950F2: g_slice_alloc (in
/usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x404F55E: g_array_sized_new (in
/usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x404F676: g_array_new (in
/usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x40A0423: g_static_private_set (in
/usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x4075A43: (within /usr/lib/libglib-2.0.so.0.1600.6)==6087==
by 0x407606C: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x4079852:
(within /usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x4079D71: g_main_loop_run (in
/usr/lib/libglib-2.0.so.0.1600.6)==6087== by 0x806F805: init (init.c:193)
I set up the main loop like this:
loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(loop);
What am I doing wrong?
BRs
/Sune
_________________________________________________________________
Senaste sportnyheterna & rykande färska resultat!
http://sport.msn.se/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]