Skip to content

Instantly share code, notes, and snippets.

@herzi
Created August 11, 2010 18:57
Show Gist options
  • Save herzi/519529 to your computer and use it in GitHub Desktop.
Save herzi/519529 to your computer and use it in GitHub Desktop.
GList* new = NULL;
for (; old; old = g_list_delete_link (old, old))
{
if (removable)
{
new = g_list_prepend (new, old->data);
}
else
{
g_object_unref (old->data); /* or g_free() or whetever is appropriate */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment