Maarten Lankhorst : dsound: Reassign pointers back to null when destroying structure.
Alexandre Julliard
julliard at winehq.org
Mon Nov 12 06:27:47 CST 2007
Module: wine
Branch: master
Commit: 8c3f9c8c7efc6a2b183e941ed753a9a7e0579753
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c3f9c8c7efc6a2b183e941ed753a9a7e0579753
Author: Maarten Lankhorst <maarten at codeweavers.com>
Date: Sun Nov 11 16:00:41 2007 +0100
dsound: Reassign pointers back to null when destroying structure.
---
dlls/dsound/dsound.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index ea94713..7b2d5d6 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -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);
More information about the wine-cvs
mailing list