Re: dispose and finalize



20.01.10, 17:56, "Martin Kalbfuß" <ma kalbfuss web de>:

> Hi,
> what's the difference between dispose and finalize? And which members
> have to be freed in which of these functions?
> Thanks

In dispose you should drop all references to other GObjects.
In finalize you free other data (char *, GArray *, etc.)

"dispose" can be invoked more than one time before "finalize".
See also [1], specifically last section.

[1] http://library.gnome.org/devel/gobject/stable/gobject-memory.html

-- 
Artur


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