Henri Verbeet : ddraw: Release the wined3d surface first in ddraw_surface_destroy().

Alexandre Julliard julliard at winehq.org
Thu Apr 21 11:17:47 CDT 2011


Module: wine
Branch: master
Commit: cbf78c5d4921192a7d5022f5bb2663b5833cff4e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cbf78c5d4921192a7d5022f5bb2663b5833cff4e

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Apr 20 22:09:25 2011 +0200

ddraw: Release the wined3d surface first in ddraw_surface_destroy().

---

 dlls/ddraw/surface.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 531e529..0105848 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -244,6 +244,9 @@ void ddraw_surface_destroy(IDirectDrawSurfaceImpl *This)
         WARN("(%p): Destroying surface with refount %d\n", This, This->ref);
     }
 
+    if (This->WineD3DSurface)
+        IWineD3DSurface_Release(This->WineD3DSurface);
+
     /* Check for attached surfaces and detach them */
     if(This->first_attached != This)
     {
@@ -276,10 +279,6 @@ void ddraw_surface_destroy(IDirectDrawSurfaceImpl *This)
         }
     }
 
-    /* Now destroy the surface. Wait: It could have been released if we are a texture */
-    if(This->WineD3DSurface)
-        IWineD3DSurface_Release(This->WineD3DSurface);
-
     /* Having a texture handle set implies that the device still exists */
     if(This->Handle)
     {




More information about the wine-cvs mailing list