From 07bcdf40d1ba021f62cf62323ac3a3487bb2f347 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Thu, 2 Jan 2003 19:54:09 +0000 Subject: [PATCH] Prevent memory leak in freeing of the VertexBuffer. --- dlls/ddraw/d3dvertexbuffer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/d3dvertexbuffer.c b/dlls/ddraw/d3dvertexbuffer.c index 9d542969ed1..76c0abf6214 100644 --- a/dlls/ddraw/d3dvertexbuffer.c +++ b/dlls/ddraw/d3dvertexbuffer.c @@ -78,6 +78,7 @@ Main_IDirect3DVertexBufferImpl_7_1T_Release(LPDIRECT3DVERTEXBUFFER7 iface) ICOM_THIS_FROM(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer7, iface); TRACE("(%p/%p)->() decrementing from %lu.\n", This, iface, This->ref); if (--(This->ref) == 0) { + HeapFree(GetProcessHeap(), 0, This->vertices); HeapFree(GetProcessHeap(), 0, This); return 0; } @@ -313,9 +314,9 @@ HRESULT d3dvertexbuffer_create(IDirect3DVertexBufferImpl **obj, IDirect3DImpl *d if (TRACE_ON(ddraw)) { TRACE(" creating implementation at %p with description : \n", *obj); - TRACE(" flags : - "); DDRAW_dump_flags_(lpD3DVertBufDesc->dwCaps, flags, sizeof(flags)/sizeof(flags[0]), TRUE); - TRACE(" vertex type : - "); dump_flexible_vertex(lpD3DVertBufDesc->dwFVF); - TRACE(" num vertices : - %ld\n", lpD3DVertBufDesc->dwNumVertices); + TRACE(" flags : "); DDRAW_dump_flags_(lpD3DVertBufDesc->dwCaps, flags, sizeof(flags)/sizeof(flags[0]), TRUE); + TRACE(" vertex type : "); dump_flexible_vertex(lpD3DVertBufDesc->dwFVF); + TRACE(" num vertices : %ld\n", lpD3DVertBufDesc->dwNumVertices); }