Re: possible g_hash_table mem leak?



[...]
> > Your problem is probably that you are combining asprintf() with g_free(),
> > using g_strdup_printf should give you better results.
> >
> 
> I rewrote the code using:
> a = g_strdup_printf("a");
> 
> And have absolutely the same result!

Hmmm, maybe you found a leak;

Why dont you try running valgrind with `--num-callers=20', then
we can see who was responsable for allocating those 1076 bytes :)

Also, maybe its something like:

if (my_bytes == NULL) 
    my_bytes = alloc_once_in_program_life_time (1076);

If you do the operation twice (create/insert/delete hash table) before
exiting, do you leak 2152 bytes ?

Cheers,
                                                   -Tristan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]