An 'oldie' question... GtkCList anyone?



Hello people.

In the process of converting an old program from mSQL to MySQL, I found a
couple of potential traps and optimized a couple of functions. I now have
a problem with adding lines into a GtkCList using gtk_clist_append. The
code is like this:

char *bff, str[4];

bff = strdup("abc|def|ghi|etc"); Just to show bff has to freed later
splitline(bff, str);            This puts pointers into str to each of
                                the substrings (at the start and
                                after each |, converting them to \0 ) 
gtk_clist_append(clist, str);   Add the line,
g_free(bff);

It looks as if the g_free happens before the append, because gibberish
appears on the screen.

Is there a way to assure the append is finished before the g_free? 

John



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