Commit b6f197c7 authored by Aaryaman Vasishta's avatar Aaryaman Vasishta Committed by Alexandre Julliard

d3drm: Add helper for destroying device.

parent f421e78b
......@@ -42,6 +42,8 @@ HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HID
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data,
D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN;
void d3drm_device_destroy(struct d3drm_device *device) DECLSPEC_HIDDEN;
struct d3drm_file_header
{
WORD major;
......
......@@ -75,6 +75,11 @@ IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device)
return &device->IDirect3DRMDevice3_iface;
}
void d3drm_device_destroy(struct d3drm_device *device)
{
HeapFree(GetProcessHeap(), 0, device);
}
static inline struct d3drm_device *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMWinDevice_iface);
......@@ -871,7 +876,7 @@ static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface)
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
if (!refcount)
HeapFree(GetProcessHeap(), 0, device);
d3drm_device_destroy(device);
return refcount;
}
......
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