Commit 8a02434c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmcompos: Use CRT allocation functions.

parent 7d94983c
......@@ -79,9 +79,7 @@ static ULONG WINAPI IDirectMusicChordMapImpl_Release(IDirectMusicChordMap *iface
TRACE("(%p) ref=%ld\n", This, ref);
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
}
if (!ref) free(This);
return ref;
}
......@@ -313,11 +311,8 @@ HRESULT create_dmchordmap(REFIID lpcGUID, void **ppobj)
IDirectMusicChordMapImpl* obj;
HRESULT hr;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapImpl));
if (NULL == obj) {
*ppobj = NULL;
return E_OUTOFMEMORY;
}
if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
obj->IDirectMusicChordMap_iface.lpVtbl = &dmchordmap_vtbl;
obj->ref = 1;
dmobject_init(&obj->dmobj, &CLSID_DirectMusicChordMap,
......
......@@ -77,9 +77,7 @@ static ULONG WINAPI chordmap_track_Release(IDirectMusicTrack8 *iface)
TRACE("(%p) ref=%ld\n", This, ref);
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
}
if (!ref) free(This);
return ref;
}
......@@ -289,11 +287,8 @@ HRESULT create_dmchordmaptrack(REFIID lpcGUID, void **ppobj)
IDirectMusicChordMapTrack* track;
HRESULT hr;
track = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track));
if (!track) {
*ppobj = NULL;
return E_OUTOFMEMORY;
}
if (!(track = calloc(1, sizeof(*track)))) return E_OUTOFMEMORY;
track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl;
track->ref = 1;
dmobject_init(&track->dmobj, &CLSID_DirectMusicChordMapTrack,
......
......@@ -67,9 +67,7 @@ static ULONG WINAPI IDirectMusicComposerImpl_Release(IDirectMusicComposer *iface
TRACE("(%p) ref=%ld\n", This, ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
if (!ref) free(This);
return ref;
}
......@@ -174,11 +172,8 @@ HRESULT create_dmcomposer(REFIID riid, void **ret_iface)
IDirectMusicComposerImpl *obj;
HRESULT hr;
obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
if (!obj) {
*ret_iface = NULL;
return E_OUTOFMEMORY;
}
if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
obj->IDirectMusicComposer_iface.lpVtbl = &dmcomposer_vtbl;
obj->ref = 1;
......
......@@ -28,7 +28,6 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
......@@ -375,7 +374,7 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
/* Reads chunk data of the form:
DWORD - size of array element
element[] - Array of elements
The caller needs to heap_free() the array.
The caller needs to free() the array.
*/
HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
unsigned int *count, DWORD elem_size)
......@@ -400,10 +399,10 @@ HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk,
*count = (chunk->size - sizeof(DWORD)) / elem_size;
size = *count * elem_size;
if (!(*array = heap_alloc(size)))
if (!(*array = malloc(size)))
return E_OUTOFMEMORY;
if (FAILED(hr = stream_read(stream, *array, size))) {
heap_free(*array);
free(*array);
*array = NULL;
return hr;
}
......
......@@ -77,9 +77,7 @@ static ULONG WINAPI signpost_track_Release(IDirectMusicTrack8 *iface)
TRACE("(%p) ref=%ld\n", This, ref);
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
}
if (!ref) free(This);
return ref;
}
......@@ -277,11 +275,8 @@ HRESULT create_dmsignposttrack(REFIID lpcGUID, void **ppobj)
IDirectMusicSignPostTrack *track;
HRESULT hr;
track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track));
if (!track) {
*ppobj = NULL;
return E_OUTOFMEMORY;
}
if (!(track = calloc(1, sizeof(*track)))) return E_OUTOFMEMORY;
track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl;
track->ref = 1;
dmobject_init(&track->dmobj, &CLSID_DirectMusicSignPostTrack,
......
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