From eba298017d2fd512c50b8a2063c106bb9475bfbc Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Mon, 16 Aug 2004 19:59:37 +0000 Subject: [PATCH] Allow proper release while capturing. --- dlls/dsound/capture.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index ed17a5bd26b..6cb5a9270ad 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -418,15 +418,15 @@ IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface ) if ( uRef == 0 ) { TRACE("deleting object\n"); + if (This->capture_buffer) + IDirectSoundCaptureBufferImpl_Release( + (LPDIRECTSOUNDCAPTUREBUFFER8) This->capture_buffer); + if (This->driver) { IDsCaptureDriver_Close(This->driver); IDsCaptureDriver_Release(This->driver); } - if (This->capture_buffer) - IDirectSoundCaptureBufferImpl_Release( - (LPDIRECTSOUNDCAPTUREBUFFER8) This->capture_buffer); - if (This->pwfx) HeapFree(GetProcessHeap(), 0, This->pwfx); @@ -1012,6 +1012,9 @@ IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface ) if ( uRef == 0 ) { TRACE("deleting object\n"); + if (This->dsound->state == STATE_CAPTURING) + This->dsound->state = STATE_STOPPING; + if (This->pdscbd) HeapFree(GetProcessHeap(),0, This->pdscbd);