Re: Memory question



Colossus wrote:
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;

gchar *msg = g_strdup_printf("%s", g_strerror(errno));
response = ShowGtkMessageDialog(GTK_WINDOW(MainWindow), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, msg);
g_free(msg);
return;


Cheers,

~david



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