Commit 80348ec5 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Avoid reading freed memory when destroying shader resource views.

parent 36a1bc1f
...@@ -228,13 +228,14 @@ ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_v ...@@ -228,13 +228,14 @@ ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_v
if (!refcount) 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, /* Call wined3d_object_destroyed() before releasing the resource,
* since releasing the resource may end up destroying the parent. */ * since releasing the resource may end up destroying the parent. */
view->parent_ops->wined3d_object_destroyed(view->parent); view->parent_ops->wined3d_object_destroyed(view->parent);
wined3d_resource_decref(view->resource);
wined3d_cs_emit_destroy_object(device->cs, wined3d_shader_resource_view_destroy_object, view); wined3d_cs_emit_destroy_object(device->cs, wined3d_shader_resource_view_destroy_object, view);
wined3d_resource_decref(resource);
} }
return refcount; 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