Refcounting in dsound

Robert Reif reif at earthlink.net
Mon Jan 24 11:21:25 CST 2005


Paul Vriens wrote:

>Hi, 
>
>while going through some leftover TRACE's of the Interlocked cleanup, I
>found the following refcounting in dsound/buffer.c and dsound.c:
>
>dsound/buffer.c:                        This->buffer->ref--;
>dsound/buffer.c:                This->buffer->ref--;
>dsound/dsound.c:        dsb->buffer->ref++;
>
>Is there a need to clean (i.e. use Interlocked*) this up?
>
>Cheers,
>
>Paul.
>
>
>  
>
buffer is not a COM object.  Using Interlocked* functions will not
make it thread safe.  This needs to be put under the dsb lock to be
correct but the odds of a program duplicating a buffer in one thread
while deleting a duplicated buffer in another are slim.  I'll look
into fixing this when I get a chance.




More information about the wine-devel mailing list