Re: Memory question
- From: Colossus <colossus 3000 it>
- To: Allin Cottrell <cottrell wfu edu>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Memory question
- Date: Wed, 28 Sep 2005 10:55:01 -0700
Hi,
Am I doing the same ( memory leaking ) with g_strdup_printf ?
If so what is the better way to write the following code: ?
response = ShowGtkMessageDialog (GTK_WINDOW
(MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,
g_strdup_printf ("%s",g_strerror(errno)) );
return;
Thank you,
Colossus
Allin Cottrell wrote:
Yes, since the allocated string will not be freed by gtk_entry_set_text().
gchar *text = g_strdup_printf("banana %d", i);
gtk_entry_set_text(GTK_ENTRY(entry), text);
g_free(text);
Allin Cottrell
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
Colossus
Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]