Alistair Leslie-Hughes : dmime: Free list when Tempo track is destroyed.

Alexandre Julliard julliard at winehq.org
Thu Nov 14 15:51:28 CST 2019


Module: wine
Branch: master
Commit: 791e15b562b3feb1a6a438ae193ec428c68caaaa
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=791e15b562b3feb1a6a438ae193ec428c68caaaa

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Thu Nov 14 20:40:26 2019 +0100

dmime: Free list when Tempo track is destroyed.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmime/tempotrack.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/dlls/dmime/tempotrack.c b/dlls/dmime/tempotrack.c
index 1ee6c5ac78..7aff40dbfd 100644
--- a/dlls/dmime/tempotrack.c
+++ b/dlls/dmime/tempotrack.c
@@ -21,6 +21,8 @@
 #include "dmime_private.h"
 #include "dmobject.h"
 
+#include "wine/heap.h"
+
 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
 WINE_DECLARE_DEBUG_CHANNEL(dmfile);
 
@@ -82,7 +84,17 @@ static ULONG WINAPI tempo_track_Release(IDirectMusicTrack8 *iface)
     TRACE("(%p) ref=%d\n", This, ref);
 
     if (!ref) {
-        HeapFree(GetProcessHeap(), 0, This);
+        struct list *cursor, *cursor2;
+        DMUS_PRIVATE_TEMPO_ITEM *item;
+
+        LIST_FOR_EACH_SAFE(cursor, cursor2, &This->Items) {
+            item = LIST_ENTRY(cursor, DMUS_PRIVATE_TEMPO_ITEM, entry);
+            list_remove(cursor);
+
+            heap_free(item);
+        }
+
+        heap_free(This);
         DMIME_UnlockModule();
     }
 




More information about the wine-cvs mailing list