diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index f981cf5b83f..53230cb6149 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 e0706fc6ebb..7737b12eedf 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 38f48149513..b3c19e76a71 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 10d9dc46961..1b6d6ff1ed0 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);