Re: gtk_combo_set_popdown_strings() coppies data?



On Thu, 18 Jan 2001, Jonathan Irwin wrote:

On Thu, 18 Jan 2001, Marco Quezada wrote:

GList *variables_list_items;

Then in your code where you decide to clear the contents of the GList do the
following:

variables_list_items = NULL;

Won't this leak memory?  I think the proper way to do it is to iterate
through the GList, freeing all the strings if necessary, and then call
g_list_free() on the list like so:

I use:

g_list_foreach(glist, (G_FUNC)g_free, NULL);
g_list_free(glist);

To deallocate each string and then the glist itself *after* the GtkCombo
has been destroyed.

HOWEVER: In another post I asked, if my GtkCombo is destroyed first, and
then the "destroy" signal is emitted, in my "destroy" signal function
should I deallocate the glist or not? Because I need to know if the
"destroy" signal is emitted before or after the widget is destroyed??


--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/





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