dsound: Reassign pointers back to null when destroying structure.

This commit is contained in:
Maarten Lankhorst 2007-11-11 16:00:41 +01:00 committed by Alexandre Julliard
parent 89b9af7714
commit 8c3f9c8c7e
1 changed files with 5 additions and 0 deletions

View File

@ -359,6 +359,7 @@ static ULONG WINAPI IDirectSound_IUnknown_Release(
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
((IDirectSoundImpl*)This->pds)->pUnknown = NULL;
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
@ -437,6 +438,7 @@ static ULONG WINAPI IDirectSound_IDirectSound_Release(
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
((IDirectSoundImpl*)This->pds)->pDS = NULL;
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
@ -598,6 +600,7 @@ static ULONG WINAPI IDirectSound8_IUnknown_Release(
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
((IDirectSoundImpl*)This->pds)->pUnknown = NULL;
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
@ -676,6 +679,7 @@ static ULONG WINAPI IDirectSound8_IDirectSound_Release(
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
((IDirectSoundImpl*)This->pds)->pDS = NULL;
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);
@ -837,6 +841,7 @@ static ULONG WINAPI IDirectSound8_IDirectSound8_Release(
ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref + 1);
if (!ref) {
((IDirectSoundImpl*)This->pds)->pDS8 = NULL;
IDirectSoundImpl_Release(This->pds);
HeapFree(GetProcessHeap(), 0, This);
TRACE("(%p) released\n", This);