Re: GtkLabel question
- From: Havoc Pennington <hp redhat com>
- To: Lucas Di Pentima <lucas lunix com ar>
- Cc: GNOME Devel List <gnome-devel-list gnome org>
- Subject: Re: GtkLabel question
- Date: Mon, 19 May 2003 12:03:19 -0400
On Mon, May 19, 2003 at 12:42:50PM -0300, Lucas Di Pentima wrote:
> It's weird, memprof tells me that there's a memory leak when I do some
> thing like:
>
> - ------------------------------------------------------------
> GtkLabel *label;
> gint i;
> ...
> gtk_label_set_text(label, g_strdup_printf("%d", i));
> - ------------------------------------------------------------
>
> If gtk_label_set_text() copies the string, isn't the string generated
> with g_strdup_printf() freed automatically?
No. C is not garbage collected, nor does it have destructors. You
have to understand and manage malloc(), free(), and pointers
explicitly.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]