Commit 6fc54611 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Wait for the resource to become idle when destroying user memory textures.

parent d82cbea6
......@@ -871,6 +871,12 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
if (!refcount)
{
/* Wait for the texture to become idle if it's using user memory,
* since the application is allowed to free that memory once the
* texture is destroyed. Note that this implies that
* wined3d_texture_destroy_object() can't access that memory either. */
if (texture->user_memory)
wined3d_resource_wait_idle(&texture->resource);
wined3d_texture_sub_resources_destroyed(texture);
texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent);
resource_cleanup(&texture->resource);
......
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