Alistair Leslie-Hughes : dmstyle: Free list when Style track is destroyed.

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


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

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

dmstyle: Free list when Style 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/dmstyle/styletrack.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/dlls/dmstyle/styletrack.c b/dlls/dmstyle/styletrack.c
index 496e0c5ba7..cc15bd81d1 100644
--- a/dlls/dmstyle/styletrack.c
+++ b/dlls/dmstyle/styletrack.c
@@ -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();
     }
 




More information about the wine-cvs mailing list