Re: Doubt about free or dont free
- From: "David Necas (Yeti)" <yeti physics muni cz>
- To: Arx Henrique <arxcruz gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Doubt about free or dont free
- Date: Fri, 22 Jul 2005 21:39:41 +0200
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?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]