Re: Doubt about free or dont free



Tks x)
next time i'll read api

On 7/22/05, David Necas (Yeti) <yeti physics muni cz> wrote:
On Fri, Jul 22, 2005 at 04:31:39PM -0300, Arx Henrique wrote:
i have a GtkEntry with a signal "activate" and this handle:

void translate(GtkEntry *widget, gpointer *data) {
      const gchar *text;
      text = gtk_entry_get_text(widget);
      gui_app_notify_new(text);
      g_free(text);
      gtk_editable_delete_text(GTK_EDITABLE(widget), 0, -1);
}

my doubt is g_free or not g_free the text?

When in doubt, read API docs:

    This string points to internally allocated storage in
    the widget and must not be freed, modified or stored.

Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



-- 
"A fé remove montanas, mas eu prefiro a dinamite"



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