Commit 5959e1d4 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent 37df4671
......@@ -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;
}
......
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment