Пример #1
0
static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface)
{
    struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface);
    ULONG refcount = InterlockedDecrement(&state->refcount);

    TRACE("%p decreasing refcount to %u.\n", state, refcount);

    if (!refcount)
    {
        struct d3d10_device *device = impl_from_ID3D10Device(state->device);
        wine_rb_remove(&device->blend_states, &state->desc);
        ID3D10Device1_Release(state->device);
        HeapFree(GetProcessHeap(), 0, state);
    }

    return refcount;
}
Пример #2
0
static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerState *iface)
{
    struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface);
    ULONG refcount = InterlockedDecrement(&state->refcount);

    TRACE("%p decreasing refcount to %u.\n", state, refcount);

    if (!refcount)
    {
        struct d3d_device *device = impl_from_ID3D11Device(state->device);
        wined3d_mutex_lock();
        wine_rb_remove(&device->rasterizer_states, &state->desc);
        ID3D11Device_Release(state->device);
        wined3d_private_store_cleanup(&state->private_store);
        wined3d_mutex_unlock();
        HeapFree(GetProcessHeap(), 0, state);
    }

    return refcount;
}