Henri Verbeet : ddraw: Get rid of the surfaces field in IDirectDrawImpl.

Alexandre Julliard julliard at winehq.org
Thu Sep 15 12:34:52 CDT 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Sep 14 20:17:28 2011 +0200

ddraw: Get rid of the surfaces field in IDirectDrawImpl.

---

 dlls/ddraw/ddraw.c         |    1 -
 dlls/ddraw/ddraw_private.h |    1 -
 dlls/ddraw/main.c          |    5 ++---
 dlls/ddraw/surface.c       |    1 -
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index f981cf5..53230cb 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2633,7 +2633,6 @@ static HRESULT ddraw_create_surface(IDirectDrawImpl *This, DDSURFACEDESC2 *pDDSD
     }
 
     /* Increase the surface counter, and attach the surface */
-    InterlockedIncrement(&This->surfaces);
     list_add_head(&This->surface_list, &(*ppSurf)->surface_list_entry);
 
     TRACE("Created surface %p.\n", *ppSurf);
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index e0706fc..7737b12 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -114,7 +114,6 @@ struct IDirectDrawImpl
      * because of IParent
      */
     struct list surface_list;
-    LONG surfaces;
 
     /* FVF management */
     struct FvfToDecl       *decls;
diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index 38f4814..b3c19e7 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -960,9 +960,8 @@ DllMain(HINSTANCE hInstDLL,
                         ERR("(%p) EnumSurfaces failed, prepare for trouble\n", ddraw);
                 }
 
-                /* Check the surface count */
-                if(ddraw->surfaces > 0)
-                    ERR("DDraw %p still has %d surfaces attached\n", ddraw, ddraw->surfaces);
+                if (!list_empty(&ddraw->surface_list))
+                    ERR("DDraw %p still has surfaces attached.\n", ddraw);
 
                 /* Release all hanging references to destroy the objects. This
                     * restores the screen mode too
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 10d9dc4..1b6d6ff 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5098,7 +5098,6 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren
         ddraw_free_handle(&surface->ddraw->d3ddevice->handle_table, surface->Handle - 1, DDRAW_HANDLE_SURFACE);
 
     /* Reduce the ddraw surface count. */
-    InterlockedDecrement(&surface->ddraw->surfaces);
     list_remove(&surface->surface_list_entry);
 
     HeapFree(GetProcessHeap(), 0, surface);




More information about the wine-cvs mailing list