Commit eeca42b3 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dmstyle: Free list when Style track is destroyed.

parent 14e36e61
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "dmstyle_private.h" #include "dmstyle_private.h"
#include "dmobject.h" #include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
WINE_DECLARE_DEBUG_CHANNEL(dmfile); WINE_DECLARE_DEBUG_CHANNEL(dmfile);
...@@ -80,7 +82,18 @@ static ULONG WINAPI style_track_Release(IDirectMusicTrack8 *iface) ...@@ -80,7 +82,18 @@ static ULONG WINAPI style_track_Release(IDirectMusicTrack8 *iface)
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if (!ref) { if (!ref) {
HeapFree(GetProcessHeap(), 0, This); struct list *cursor, *cursor2;
DMUS_PRIVATE_STYLE_ITEM *item;
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->Items) {
item = LIST_ENTRY(cursor, DMUS_PRIVATE_STYLE_ITEM, entry);
list_remove(cursor);
IDirectMusicStyle8_Release(item->pObject);
heap_free(item);
}
heap_free(This);
DMSTYLE_UnlockModule(); 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