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:
parent
24dc508fa7
commit
551843da1d
1 changed files with 2 additions and 8 deletions
|
@ -111,16 +111,10 @@ _katze_array_move_item (KatzeArray* array,
|
||||||
static void
|
static void
|
||||||
_katze_array_clear (KatzeArray* array)
|
_katze_array_clear (KatzeArray* array)
|
||||||
{
|
{
|
||||||
guint n;
|
|
||||||
guint i;
|
|
||||||
GObject* item;
|
GObject* item;
|
||||||
|
|
||||||
n = g_list_length (array->items);
|
while ((item = g_list_nth_data (array->items, 0)))
|
||||||
for (i = 0; i < n; i++)
|
katze_array_remove_item (array, item);
|
||||||
{
|
|
||||||
if ((item = g_list_nth_data (array->items, i)))
|
|
||||||
katze_array_remove_item (array, item);
|
|
||||||
}
|
|
||||||
g_list_free (array->items);
|
g_list_free (array->items);
|
||||||
array->items = NULL;
|
array->items = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue