Re: Re: Why there's still ONE element left after g_slist_free () ?



> Its old hat to C programmers that you set any object to NULL when you're done with it,
> which returns the memory used to the heap. That's not necessary with languages that
> have garbage collection like Java, Python, etc.

Yes and no. One could say that on the contrary, in languages with
garbage collection the only way to (implicitly, eventually) "free"
something  is to make sure there are no pointers to it, i.e. set the
pointers to NULL or to point to something else. There are no explicit
"free" calls. (Of course, such languages generally don't use the term
"pointer".)

--tml


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