Commit 4ae866a0 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmusic: Stop leaking instruments on collection release.

parent 572125ed
......@@ -98,7 +98,18 @@ static ULONG WINAPI collection_Release(IDirectMusicCollection *iface)
TRACE("(%p): new ref = %lu\n", iface, ref);
if (!ref) {
if (!ref)
{
struct instrument_entry *instrument_entry;
void *next;
LIST_FOR_EACH_ENTRY_SAFE(instrument_entry, next, &This->instruments, struct instrument_entry, entry)
{
list_remove(&instrument_entry->entry);
IDirectMusicInstrument_Release(instrument_entry->instrument);
free(instrument_entry);
}
free(This);
}
......
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