static void d3drm_texture_destroy(struct d3drm_texture *texture) { TRACE("texture %p is being destroyed.\n", texture); d3drm_object_cleanup((IDirect3DRMObject*)&texture->IDirect3DRMTexture_iface, &texture->obj); if (texture->image) IDirect3DRM_Release(texture->d3drm); HeapFree(GetProcessHeap(), 0, texture); }
static ULONG WINAPI d3drm_face1_Release(IDirect3DRMFace *iface) { struct d3drm_face *face = impl_from_IDirect3DRMFace(iface); ULONG refcount = InterlockedDecrement(&face->ref); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) { d3drm_object_cleanup((IDirect3DRMObject *)iface, &face->obj); heap_free(face); } return refcount; }
void d3drm_device_destroy(struct d3drm_device *device) { d3drm_object_cleanup((IDirect3DRMObject *)&device->IDirect3DRMDevice_iface, &device->obj); if (device->device) { TRACE("Releasing attached ddraw interfaces.\n"); IDirect3DDevice_Release(device->device); } if (device->render_target) IDirectDrawSurface_Release(device->render_target); if (device->primary_surface) { TRACE("Releasing primary surface and attached clipper.\n"); IDirectDrawSurface_Release(device->primary_surface); IDirectDrawClipper_Release(device->clipper); } if (device->ddraw) { IDirectDraw_Release(device->ddraw); IDirect3DRM_Release(device->d3drm); } HeapFree(GetProcessHeap(), 0, device); }