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
1 changed files with 6 additions and 0 deletions

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);