Commit 96fd03b2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dmloader: Use safe list iterator when clearing the cache (Coverity).

parent b9a03b70
......@@ -776,11 +776,11 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 *
static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *iface, REFGUID class)
{
IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface);
struct cache_entry *obj;
struct cache_entry *obj, *obj2;
TRACE("(%p, %s)\n", This, debugstr_dmguid(class));
LIST_FOR_EACH_ENTRY(obj, &This->cache, struct cache_entry, entry) {
LIST_FOR_EACH_ENTRY_SAFE(obj, obj2, &This->cache, struct cache_entry, entry) {
if ((IsEqualGUID(class, &GUID_DirectMusicAllTypes) || IsEqualGUID(class, &obj->Desc.guidClass)) &&
(obj->Desc.dwValidData & DMUS_OBJ_LOADED)) {
/* basically, wrap to ReleaseObject for each object found */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment