From: Anton Baskanov baskanov@gmail.com
Otherwise, the object won't be found in the cache and will leak on release. --- dlls/dmloader/loader.c | 2 ++ dlls/dmloader/tests/loader.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index bfcc32da49c..d8bad56c7f2 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -445,12 +445,14 @@ static HRESULT WINAPI loader_GetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDE pObjectEntry = calloc(1, sizeof(*pObjectEntry)); DM_STRUCT_INIT(&pObjectEntry->Desc); DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); + pObjectEntry->Desc.dwValidData |= DMUS_OBJ_LOADED; pObjectEntry->pObject = pObject; list_add_head(&This->cache, &pObjectEntry->entry); } else { DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); + pObjectEntry->Desc.dwValidData |= DMUS_OBJ_LOADED; pObjectEntry->pObject = pObject; } TRACE(": filled in cache entry\n"); diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c index ac6878690c3..3b6d9a159a8 100644 --- a/dlls/dmloader/tests/loader.c +++ b/dlls/dmloader/tests/loader.c @@ -199,7 +199,7 @@ static void test_clear_cache(void)
/* ClearCache releases the loaded objects */ refcount = IDirectMusicCollection_Release(collection); - todo_wine ok(!refcount, "refcount == %lu, expected 0\n", refcount); + ok(!refcount, "refcount == %lu, expected 0\n", refcount); if (segment) { refcount = IDirectMusicSegment_Release(segment);