Re: dispose and finalize



On Wed, 20 Jan 2010 17:56:18 +0100 Martin Kalbfuß wrote:

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

See http://library.gnome.org/devel/gobject/unstable/gobject-memory.html

The difference in short:

dispose:
- g_object_unref() all GObject member variables
- function must be safe against being called multiple times

finalize:
- free all other (non-GObject) members, close file descriptors etc

Holger


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