Commit 6dedfec9 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmsynth: Use CRT allocation functions.

parent 5e29d147
......@@ -96,7 +96,7 @@ static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface)
if (!ref) {
if (This->latency_clock)
IReferenceClock_Release(This->latency_clock);
HeapFree(GetProcessHeap(), 0, This);
free(This);
}
return ref;
......@@ -744,11 +744,8 @@ HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj)
TRACE("(%s, %p)\n", debugstr_guid(riid), ppobj);
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj));
if (NULL == obj) {
*ppobj = NULL;
return E_OUTOFMEMORY;
}
*ppobj = NULL;
if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
obj->IDirectMusicSynth8_iface.lpVtbl = &synth_vtbl;
obj->IKsControl_iface.lpVtbl = &synth_control_vtbl;
obj->ref = 1;
......
......@@ -92,7 +92,7 @@ static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface)
IReferenceClock_Release(This->latency_clock);
if (This->master_clock)
IReferenceClock_Release(This->master_clock);
HeapFree(GetProcessHeap(), 0, This);
free(This);
}
return ref;
......@@ -315,10 +315,7 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface)
*ret_iface = NULL;
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct synth_sink));
if (!obj)
return E_OUTOFMEMORY;
if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
obj->IDirectMusicSynthSink_iface.lpVtbl = &synth_sink_vtbl;
obj->IKsControl_iface.lpVtbl = &synth_sink_control;
obj->ref = 1;
......@@ -326,7 +323,7 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface)
hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&obj->latency_clock);
if (FAILED(hr))
{
HeapFree(GetProcessHeap(), 0, obj);
free(obj);
return hr;
}
......
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