problem



hello,

here is a selected part of my code:
------------------------------------------------
static void fct2(GtkWidget *entry[])
{
gchar *str=malloc(500);

str=gtk_entry_get_text(GTK_ENTRY(entry[0]));
printf("str=%s\n",str);<- segfault (of weird string)
fflush(stdout);
}

void fct1()
{
GtkWidget **entry=g_new(GtkWidget *,4);

gtk_signal_connect_object(GTK_OBJECT(button),"clicked",GTK_SIGNAL_FUNC(fct2),(gpointer)entry);
}
-------------------------------------------------

My problem is that if I click only one time on "button", I get the good
result but if I click again on "button", I get a segfault...
Where is the pb? Furthermore, I hope there is enough code source to
undestand my pb....

Anthony

-- 
http://www.freeciv.fr.st




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