wined3d: Destroy the resource after view in wined3d_rendertarget_view_decref.

Signed-off-by: Stefan Dösinger <stefandoesinger@gmx.at>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Stefan Dösinger 2016-07-03 16:49:35 +01:00 committed by Alexandre Julliard
parent 4c71e37bbd
commit d8da1db891

View file

@ -46,13 +46,14 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v
if (!refcount)
{
struct wined3d_device *device = view->resource->device;
struct wined3d_resource *resource = view->resource;
struct wined3d_device *device = resource->device;
/* Call wined3d_object_destroyed() before releasing the resource,
* since releasing the resource may end up destroying the parent. */
view->parent_ops->wined3d_object_destroyed(view->parent);
wined3d_resource_decref(view->resource);
wined3d_cs_emit_destroy_object(device->cs, wined3d_rendertarget_view_destroy_object, view);
wined3d_resource_decref(resource);
}
return refcount;