Ken Thomases : dsound: Consolidate some duplicate code.

Alexandre Julliard julliard at winehq.org
Tue Feb 24 10:21:21 CST 2009


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

Author: Ken Thomases <ken at codeweavers.com>
Date:   Mon Feb 23 17:34:03 2009 -0600

dsound: Consolidate some duplicate code.

---

 dlls/dsound/buffer.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
index abff0c9..688ad71 100644
--- a/dlls/dsound/buffer.c
+++ b/dlls/dsound/buffer.c
@@ -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) {




More information about the wine-cvs mailing list