dmstyle: Free list when Style track is destroyed.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2019-11-14 20:40:25 +01:00 committed by Alexandre Julliard
parent 14e36e6194
commit eeca42b32f
1 changed files with 14 additions and 1 deletions

View File

@ -20,6 +20,8 @@
#include "dmstyle_private.h"
#include "dmobject.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@ -80,7 +82,18 @@ static ULONG WINAPI style_track_Release(IDirectMusicTrack8 *iface)
TRACE("(%p) ref=%d\n", This, 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();
}