Re: To leak or seg to fault ?
- From: Havoc Pennington <hp redhat com>
- To: Tomasz Wegrzanowski <taw users sourceforge net>
- Cc: gtk-list gnome org
- Subject: Re: To leak or seg to fault ?
- Date: 21 Apr 2001 10:10:38 -0400
Tomasz Wegrzanowski <taw users sourceforge net> writes:
> 1. Should I free() all strings returned from gtk_* methods or not ?
It's about 50/50, and you should use g_free() not free(). You have to
read docs or source for each function.
In GTK 2 the strings that should not be freed have const on
them. (By default anyway.)
> 2. Should I strdup() all strings passed to gtk_* methods or not ?
> If yes, should I strdup() r/o ones too ?
No, we generally don't have methods that require this.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]