Fixed a reference counting bug I introduced.
diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 228984b..1737a2b 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c
@@ -571,20 +571,13 @@ 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); }
diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index b0999df..4be4237 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c
@@ -1042,7 +1042,8 @@ 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;