dsound: Remove the now obsolete IDirectSoundBufferImpl_Destroy().

This commit is contained in:
Michael Stefaniuc 2012-01-20 00:53:51 +01:00 committed by Alexandre Julliard
parent c7f5f10aab
commit 84d5317302
3 changed files with 7 additions and 18 deletions

View File

@ -964,6 +964,11 @@ HRESULT IDirectSoundBufferImpl_Create(
void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
{
ULONG ref = InterlockedIncrement(&This->numIfaces);
if (ref > 1)
WARN("Destroying buffer with %u in use interfaces\n", ref - 1);
DirectSoundDevice_RemoveBuffer(This->device, This);
RtlDeleteResource(&This->lock);
@ -981,20 +986,6 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
TRACE("(%p) released\n", This);
}
HRESULT IDirectSoundBufferImpl_Destroy(
IDirectSoundBufferImpl *pdsb)
{
TRACE("(%p)\n",pdsb);
/* This keeps the *_Destroy functions from possibly deleting
* this object until it is ready to be deleted */
InterlockedIncrement(&pdsb->numIfaces);
secondarybuffer_destroy(pdsb);
return S_OK;
}
HRESULT IDirectSoundBufferImpl_Duplicate(
DirectSoundDevice *device,
IDirectSoundBufferImpl **ppdsb,

View File

@ -1244,7 +1244,7 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
/* The kill event should have allowed the timer process to expire
* but try to grab the lock just in case. Can't hold lock because
* IDirectSoundBufferImpl_Destroy also grabs the lock */
* secondarybuffer_destroy also grabs the lock */
RtlAcquireResourceShared(&(device->buffer_list_lock), TRUE);
RtlReleaseResource(&(device->buffer_list_lock));
@ -1256,7 +1256,7 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
if (device->buffers) {
WARN("%d secondary buffers not released\n", device->nrofbuffers);
for( i=0;i<device->nrofbuffers;i++)
IDirectSoundBufferImpl_Destroy(device->buffers[i]);
secondarybuffer_destroy(device->buffers[i]);
}
if (device->primary) {

View File

@ -199,8 +199,6 @@ HRESULT IDirectSoundBufferImpl_Create(
DirectSoundDevice *device,
IDirectSoundBufferImpl **ppdsb,
LPCDSBUFFERDESC dsbd) DECLSPEC_HIDDEN;
HRESULT IDirectSoundBufferImpl_Destroy(
IDirectSoundBufferImpl *pdsb) DECLSPEC_HIDDEN;
HRESULT IDirectSoundBufferImpl_Duplicate(
DirectSoundDevice *device,
IDirectSoundBufferImpl **ppdsb,