1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 20:06:18 +00:00

dmusic: Stop leaking instruments on collection release.

This commit is contained in:
Rémi Bernon 2023-09-09 14:51:56 +02:00 committed by Alexandre Julliard
parent 572125edf6
commit 4ae866a0a7

View File

@ -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);
}