Re: Disposing of memory.



On Mon, Feb 17, 2003 at 06:33:21PM +1000, Mark Cox wrote:

I have created a class which is a subclass of GObject.  I have
overridden gobject's dispose method with my own and then called the
gobject's dispose method....which is all working fine.

But after I create the object, then dispose of it, I still get a single
memory leak caused by the created object. When I put g_free(theObject)
at the end of the code the leak goes away.

Is this what I am suppose to do, or should the type system clean it up
for me without calling g_free.


You probably want to be using _unref() and override finalize() instead 
of using dispose().

Havoc



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