Zebediah Figura : ddraw: Avoid leaking references to the wined3d device.

Alexandre Julliard julliard at winehq.org
Thu Nov 29 15:09:40 CST 2018


Module: wine
Branch: stable
Commit: fe1c7873bc917dc6517ac864ca7f9359da4a68ec
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fe1c7873bc917dc6517ac864ca7f9359da4a68ec

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Tue Aug 21 15:01:40 2018 -0500

ddraw: Avoid leaking references to the wined3d device.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 2689f3e68b624631e1762aa284d3968617ef3c2a)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ddraw/surface.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 26d83cd..ef06f93 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -509,7 +509,16 @@ static void ddraw_surface_cleanup(struct ddraw_surface *surface)
         surf = surface->complex_array[i];
         surface->complex_array[i] = NULL;
         if (!surf->is_complex_root)
+        {
+            struct ddraw_texture *texture = wined3d_texture_get_parent(surf->wined3d_texture);
+            struct wined3d_device *wined3d_device = texture->wined3d_device;
+            struct ddraw_surface *root = texture->root;
+
             ddraw_surface_cleanup(surf);
+
+            if (surf == root)
+                wined3d_device_decref(wined3d_device);
+        }
     }
 
     if (surface->device1)




More information about the wine-cvs mailing list