Commit b6fcb204 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

dsound: Consolidate some duplicate code.

parent ca1d074c
......@@ -380,17 +380,9 @@ static ULONG WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
DirectSoundDevice_RemoveBuffer(This->device, This);
RtlDeleteResource(&This->lock);
if (This->hwbuf) {
if (This->hwbuf)
IDsDriverBuffer_Release(This->hwbuf);
if (This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) {
This->buffer->ref--;
list_remove(&This->entry);
if (This->buffer->ref==0) {
HeapFree(GetProcessHeap(),0,This->buffer->memory);
HeapFree(GetProcessHeap(),0,This->buffer);
}
}
} else {
if (!This->hwbuf || (This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY)) {
This->buffer->ref--;
list_remove(&This->entry);
if (This->buffer->ref==0) {
......
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