Don't use g_slist_free_full() it needs a more recent GLIB than we officially

require.

svn path=/trunk/; revision=45781
This commit is contained in:
Evan Huus 2012-10-24 22:14:32 +00:00
parent bbe9e06964
commit e6639e035e
1 changed files with 10 additions and 1 deletions

View File

@ -53,8 +53,17 @@ static void
wmem_glib_free_all(void *private_data)
{
wmem_glib_allocator_t *allocator = (wmem_glib_allocator_t*) private_data;
GSList *tmp;
g_slist_free_full(allocator->block_list, &g_free);
/* We can't use g_slist_free_full() as it was only introduced in GLIB 2.28
* while we support way back to 2.14. So loop through and manually free
* each block, then call g_slist_free(). */
tmp = allocator->block_list;
while (tmp) {
g_free(tmp->data);
tmp = tmp->next;
}
g_slist_free(allocator->block_list);
allocator->block_list = NULL;
}