Re: quartz: Check allocation failure and clear memory in DSound Renderer

2007-03-09 Thread Francois Gouget
On Fri, 9 Mar 2007, Felix Nawothnig wrote: > Detlef Riekenberg wrote: > > > @@ -325,9 +328,15 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, > > > LPVOID * ppv) > > > pDSoundRender->pClock = NULL; > > > pDSoundRender->init = FALSE; > > > pDSoundRender->started = FALSE; > > ... th

Re: quartz: Check allocation failure and clear memory in DSound Renderer

2007-03-09 Thread Felix Nawothnig
Detlef Riekenberg wrote: @@ -325,9 +328,15 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv) pDSoundRender->pClock = NULL; pDSoundRender->init = FALSE; pDSoundRender->started = FALSE; ... there is no need to clear it again. However, note that NULL is not always all

Re: quartz: Check allocation failure and clear memory in DSound Renderer

2007-03-09 Thread Detlef Riekenberg
On Fr, 2007-03-09 at 03:02 -0800, Chris Robinson wrote: > +ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl)); Since you clear the whole struct, ... > pDSoundRender->lpVtbl = &DSoundRender_Vtbl; > pDSoundRender->IBasicAudio_vtbl = &IBasicAudio_Vtbl; > @@ -325,9 +328,15 @@ HRESULT

Re: quartz: Check allocation failure and clear memory in DSound Renderer

2007-03-09 Thread Chris Robinson
On Friday 09 March 2007 03:26:31 am you wrote: > The check for allocation failure is good, but clearing the memory that > is going to be initialised anyway is inefficient and unnecessary. Not all of it is initialized, which is what led me to create the patch (if the object is created then release

Re: quartz: Check allocation failure and clear memory in DSound Renderer

2007-03-09 Thread Robert Shearman
Chris Robinson wrote: return CLASS_E_NOAGGREGATION; pDSoundRender = CoTaskMemAlloc(sizeof(DSoundRenderImpl)); +if (!pDSoundRender) +return E_OUTOFMEMORY; +ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl)); pDSoundRender->lpVtbl = &DSoundRender_Vtbl;