From b42287ca66e88742828e2409c11e701a22f8f057 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 15 Aug 2007 16:43:41 +0200 Subject: [PATCH] dsound: Handle failing of obtaining IDsDriverNotify. --- dlls/dsound/capture.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index 833c03924e7..684495d6249 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -765,17 +765,18 @@ IDirectSoundCaptureBufferImpl_QueryInterface( if (!This->notify) hres = IDirectSoundCaptureNotifyImpl_Create(This, &This->notify); if (This->notify) { - if (This->device->hwbuf) { + IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify); + if (This->device->hwbuf && !This->hwnotify) { hres = IDsCaptureDriverBuffer_QueryInterface(This->device->hwbuf, &IID_IDsDriverNotify, (LPVOID*)&(This->hwnotify)); if (hres != DS_OK) { WARN("IDsCaptureDriverBuffer_QueryInterface failed\n"); + IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify); *ppobj = 0; return hres; } } - IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify); *ppobj = (LPVOID)This->notify; return DS_OK; }