quartz: Check allocation failure and clear memory in DSound Renderer

Chris Robinson chris.kcat at gmail.com
Fri Mar 9 05:47:28 CST 2007

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 released without ever being used, it may crash trying 
to delete the dsound buffer and device, since those pointers are never 
initialized when the filter isn't processed). As fields are added or changed 
to the struct, it becomes cumbersome to keep track and make sure each field 
is initialized to 0.

I suppose I could've removed the lines that set fields to 0/FALSE/NULL, but I 
didn't think to. It doesn't hurt anything to keep them (reduntantly setting a 
few extra fields to 0 when creating the filter object is the least of the 
speed concerns), but if you really want me to remove them I can send an 
updated patch.

More information about the wine-devel mailing list