Ensure we remove all items in katze_array_clear

Apparently looping through 'all' items isn't sufficient, so now
we remove the very first item until the list is empty.
This commit is contained in:
Christian Dywan 2009-05-22 02:40:02 +02:00
parent 24dc508fa7
commit 551843da1d

View file

@ -111,16 +111,10 @@ _katze_array_move_item (KatzeArray* array,
static void
_katze_array_clear (KatzeArray* array)
{
guint n;
guint i;
GObject* item;
n = g_list_length (array->items);
for (i = 0; i < n; i++)
{
if ((item = g_list_nth_data (array->items, i)))
katze_array_remove_item (array, item);
}
while ((item = g_list_nth_data (array->items, 0)))
katze_array_remove_item (array, item);
g_list_free (array->items);
array->items = NULL;
}