diff --git a/src/calibre/devices/mtp/windows/content_enumeration.cpp b/src/calibre/devices/mtp/windows/content_enumeration.cpp index 411d5dc210..3c1b8503eb 100644 --- a/src/calibre/devices/mtp/windows/content_enumeration.cpp +++ b/src/calibre/devices/mtp/windows/content_enumeration.cpp @@ -320,6 +320,7 @@ find_objects_in(CComPtr &content, CComPtr children; HRESULT hr = S_OK, hr2 = S_OK; + *enum_failed = false; Py_BEGIN_ALLOW_THREADS; hr = content->EnumObjects(0, parent_id, NULL, &children); @@ -338,7 +339,6 @@ find_objects_in(CComPtr &content, CComPtr