From f84c61b2bf744315a06c01cd4d5bf657e280feef Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 5 Apr 2010 20:08:27 +0000 Subject: [PATCH] handle getobject failure in ptp_object_want git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12904 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ptp2/ptp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c index c465574e6..c08562d96 100644 --- a/camlibs/ptp2/ptp.c +++ b/camlibs/ptp2/ptp.c @@ -4942,8 +4942,11 @@ ptp_object_want (PTPParams *params, uint32_t handle, int want, PTPObject **retob saveparent = ob->oi.ParentObject; ret = ptp_getobjectinfo (params, handle, &ob->oi); - if (ret != PTP_RC_OK) + if (ret != PTP_RC_OK) { + /* kill it from the internal list ... */ + ptp_remove_object_from_cache(params, handle); return ret; + } if (!ob->oi.Filename) ob->oi.Filename=strdup(""); if (ob->flags & PTPOBJECT_PARENTOBJECT_LOADED) ob->oi.ParentObject = saveparent;