Re: all about gobject references



On Sat, Aug 22, 2009 at 5:51 PM, Tadej BorovÅak <tadeboro gmail com> wrote:

Hi.

but still after reading thoroughly  i am unable to figure out why the
ref_count would be "4" for gtk_window_new() call ?

After gtk_window_new call, refcount is 1. Additional references are
added by callback mechanism. (Try adding print statement right after
the creation and you'll see.)

Ok i agree :)
i put printf  after gtk_main() call and found out that ref_count  is 0 which
is good way of saying the finalize will be called when the ref_count drops
to zero and the memory used for window will be returned back to the heap
which all of this means no mem leak in itself
but when i put it throught *valgrind* tool it says 156 bytes loss in memory
.........
how can i free the code from memleak   ?

Tadej

--
Tadej BorovÅak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com




-- 
Regards,
~Sid~
I have never met a man so ignorant that i couldn't learn something from him



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