dsound: Use AddRef to set the refcounts at object creation.

This commit is contained in:
Michael Stefaniuc 2012-01-16 00:14:35 +01:00 committed by Alexandre Julliard
parent 37df4671cb
commit 5959e1d48c
2 changed files with 6 additions and 4 deletions

View File

@ -900,8 +900,8 @@ HRESULT IDirectSoundBufferImpl_Create(
TRACE("Created buffer at %p\n", dsb);
dsb->ref = 1;
dsb->numIfaces = 1;
dsb->ref = 0;
dsb->numIfaces = 0;
dsb->device = device;
dsb->IDirectSoundBuffer8_iface.lpVtbl = &dsbvt;
dsb->iks = NULL;
@ -1012,6 +1012,7 @@ HRESULT IDirectSoundBufferImpl_Create(
}
}
IDirectSoundBuffer8_AddRef(&dsb->IDirectSoundBuffer8_iface);
*pdsb = dsb;
return err;
}

View File

@ -1218,9 +1218,9 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl *
return DSERR_OUTOFMEMORY;
}
dsb->ref = 1;
dsb->ref = 0;
dsb->ref3D = 0;
dsb->numIfaces = 1;
dsb->numIfaces = 0;
dsb->device = device;
dsb->IDirectSoundBuffer8_iface.lpVtbl = (IDirectSoundBuffer8Vtbl *)&dspbvt;
dsb->IDirectSound3DListener_iface.lpVtbl = &ds3dlvt;
@ -1253,6 +1253,7 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl *
device->pwfx->nBlockAlign, device->pwfx->wBitsPerSample,
device->pwfx->cbSize);
IDirectSoundBuffer_AddRef(&dsb->IDirectSoundBuffer8_iface);
*ppdsb = dsb;
return S_OK;
}