Commit e4e3c0b4 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmstyle: Free lists when IDirectMusicStyleImpl is destroyed.

parent b9a50481
......@@ -108,7 +108,25 @@ static ULONG WINAPI IDirectMusicStyle8Impl_Release(IDirectMusicStyle8 *iface)
TRACE("(%p) ref=%d\n", This, ref);
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
struct style_band *band, *band2;
struct style_motif *motif, *motif2;
struct style_partref_item *item, *item2;
LIST_FOR_EACH_ENTRY_SAFE(band, band2, &This->bands, struct style_band, entry) {
list_remove(&band->entry);
if (band->pBand)
IDirectMusicBand_Release(band->pBand);
heap_free(band);
}
LIST_FOR_EACH_ENTRY_SAFE(motif, motif2, &This->motifs, struct style_motif, entry) {
list_remove(&motif->entry);
LIST_FOR_EACH_ENTRY_SAFE(item, item2, &motif->Items, struct style_partref_item, entry) {
list_remove(&item->entry);
heap_free(item);
}
heap_free(motif);
}
heap_free(This);
DMSTYLE_UnlockModule();
}
......
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