dsound: Fix double free in dsound capture.

This commit is contained in:
Michael Karcher 2008-05-30 09:34:45 +02:00 committed by Alexandre Julliard
parent 9dc3ecb9e3
commit 84fd6e629a

View File

@ -860,6 +860,12 @@ IDirectSoundCaptureBufferImpl_Release( LPDIRECTSOUNDCAPTUREBUFFER8 iface )
if (This->notify)
IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify);
/* If driver manages its own buffer, IDsCaptureDriverBuffer_Release
should have freed the buffer. Prevent freeing it again in
IDirectSoundCaptureBufferImpl_Create */
if (!(This->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY))
This->device->buffer = NULL;
HeapFree(GetProcessHeap(), 0, This->notifies);
HeapFree( GetProcessHeap(), 0, This );
TRACE("(%p) released\n", This);