[PATCH 6/7] wined3d: Wait for the resource to become idle when destroying user memory textures.

Henri Verbeet hverbeet at codeweavers.com
Tue Sep 20 04:41:40 CDT 2016


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/texture.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 8e5a5f1..1c44a5d 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -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);
-- 
2.1.4




More information about the wine-patches mailing list