gp_list_unref can never free the list due to bad checking.

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9971 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2007-02-04 10:14:47 +00:00
parent 04d8aba64f
commit 214fad46ce

View File

@@ -143,11 +143,10 @@ gp_list_unref (CameraList *list)
{
CHECK_LIST (list);
list->ref_count--;
if (!list->ref_count)
if (list->ref_count == 1) /* time to free */
gp_list_free (list);
else
list->ref_count--;
return (GP_OK);
}