Commit 05fb2c89 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Fixed a reference counting bug I introduced.

parent c5f775a9
......@@ -571,20 +571,13 @@ static DWORD WINAPI PrimaryBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface) {
ref = InterlockedDecrement(&(This->ref));
/* the listener has a reference to us which must be removed */
if ((ref == 0) || ((ref == 1) && (This->dsound->listener))) {
if (ref == 0) {
IDirectSound_Release((LPDIRECTSOUND)This->dsound);
if (This->dsound->listener) {
IDirectSound3DListener_Release((LPDIRECTSOUND3DLISTENER)This->dsound->listener);
This->dsound->listener = NULL;
ref--;
}
#if 0
if (This->iks) {
HeapFree(GetProcessHeap(), 0, This->iks);
}
#endif
HeapFree(GetProcessHeap(),0,This);
}
......
......@@ -1042,7 +1042,8 @@ HRESULT WINAPI IDirectSound3DListenerImpl_Create(
InitializeCriticalSection(&dsl->lock);
dsl->dsb = This;
IDirectSoundBuffer8_AddRef((LPDIRECTSOUNDBUFFER8)This);
/* NOTE: don't add a reference because it would cause a circular reference */
/* IDirectSoundBuffer8_AddRef((LPDIRECTSOUNDBUFFER8)This); */
*pdsl = dsl;
return S_OK;
......
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