Commit 8c3f9c8c authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

dsound: Reassign pointers back to null when destroying structure.

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