Commit adc6948c authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Remove lock name from lock debug structure before deletion so it gets

freed properly.
parent 3d7299b7
......@@ -394,6 +394,7 @@ static DWORD WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface)
DSOUND_RemoveBuffer(This->dsound, This);
This->lock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection(&(This->lock));
if (This->hwbuf) {
......@@ -1223,6 +1224,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
HeapFree(GetProcessHeap(),0,dsb->buffer->memory);
if (dsb->buffer)
HeapFree(GetProcessHeap(),0,dsb->buffer);
dsb->lock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection(&(dsb->lock));
HeapFree(GetProcessHeap(),0,dsb->pwfx);
HeapFree(GetProcessHeap(),0,dsb);
......
......@@ -415,6 +415,7 @@ IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface )
if (This->pwfx)
HeapFree(GetProcessHeap(), 0, This->pwfx);
This->lock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection( &(This->lock) );
HeapFree( GetProcessHeap(), 0, This );
dsound_capture = NULL;
......@@ -1787,6 +1788,7 @@ IDirectSoundFullDuplexImpl_Release( LPDIRECTSOUNDFULLDUPLEX iface )
LeaveCriticalSection( &(This->lock) );
if ( uRef == 0 ) {
This->lock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection( &(This->lock) );
HeapFree( GetProcessHeap(), 0, This );
TRACE("(%p) released\n",This);
......
......@@ -302,6 +302,7 @@ static ULONG WINAPI IDirectSoundImpl_Release(
IDsDriver_Release(This->driver);
RtlDeleteResource(&This->buffer_list_lock);
This->mixlock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection(&This->mixlock);
HeapFree(GetProcessHeap(),0,This);
dsound = NULL;
......@@ -604,6 +605,7 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
hres = DSOUND_AddBuffer(This, dsb);
if (hres != DS_OK) {
IDirectSoundBuffer8_Release(psb);
dsb->lock.DebugInfo->Spare[1] = 0;
DeleteCriticalSection(&(dsb->lock));
HeapFree(GetProcessHeap(),0,dsb->buffer);
HeapFree(GetProcessHeap(),0,dsb->pwfx);
......
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