From d8da1db891c3cb33c16ccfbfbaf48cfeefc7b020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 3 Jul 2016 16:49:35 +0100 Subject: [PATCH] wined3d: Destroy the resource after view in wined3d_rendertarget_view_decref. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Dösinger Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/view.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 985c3432262..7f07d574c4a 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -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;