[PATCH 3/5] wined3d: Free the adapter's format info in IWineD3DImpl_Release() (Valgrind).
Henri Verbeet
hverbeet at codeweavers.com
Wed Oct 21 03:33:59 CDT 2009
---
dlls/wined3d/directx.c | 8 +++++++-
dlls/wined3d/utils.c | 2 ++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index bd26408..bc9691f 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -334,6 +334,12 @@ long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram)
return adapter->UsedTextureRam;
}
+static void wined3d_adapter_cleanup(struct wined3d_adapter *adapter)
+{
+ HeapFree(GetProcessHeap(), 0, adapter->gl_info.gl_formats);
+ HeapFree(GetProcessHeap(), 0, adapter->cfgs);
+}
+
/**********************************************************
* IUnknown parts follows
**********************************************************/
@@ -372,7 +378,7 @@ static ULONG WINAPI IWineD3DImpl_Release(IWineD3D *iface) {
for (i = 0; i < This->adapter_count; ++i)
{
- HeapFree(GetProcessHeap(), 0, This->adapters[i].cfgs);
+ wined3d_adapter_cleanup(&This->adapters[i]);
}
HeapFree(GetProcessHeap(), 0, This);
}
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 573be8f..3f736c7 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1112,6 +1112,7 @@ BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info)
if (!init_format_compression_info(gl_info))
{
HeapFree(GetProcessHeap(), 0, gl_info->gl_formats);
+ gl_info->gl_formats = NULL;
return FALSE;
}
@@ -1135,6 +1136,7 @@ BOOL initPixelFormats(struct wined3d_gl_info *gl_info)
fail:
HeapFree(GetProcessHeap(), 0, gl_info->gl_formats);
+ gl_info->gl_formats = NULL;
return FALSE;
}
--
1.6.4.4
More information about the wine-patches
mailing list