=?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: d3dx9: Introduce free_constant_table() .
Alexandre Julliard
julliard at winehq.org
Mon Jan 23 13:00:56 CST 2012
Module: wine
Branch: master
Commit: 4a6e06d7bbf3228f91f117f8d61cfa82917ffc01
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4a6e06d7bbf3228f91f117f8d61cfa82917ffc01
Author: Rico Schüller <kgbricola at web.de>
Date: Sun Jan 22 11:28:52 2012 +0100
d3dx9: Introduce free_constant_table().
---
dlls/d3dx9_36/shader.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index fd7e6b7..9a9d77c 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -632,6 +632,12 @@ typedef struct ID3DXConstantTableImpl {
ctab_constant *constants;
} ID3DXConstantTableImpl;
+static void free_constant_table(struct ID3DXConstantTableImpl *table)
+{
+ HeapFree(GetProcessHeap(), 0, table->constants);
+ HeapFree(GetProcessHeap(), 0, table->ctab);
+}
+
static inline ID3DXConstantTableImpl *impl_from_ID3DXConstantTable(ID3DXConstantTable *iface)
{
return CONTAINING_RECORD(iface, ID3DXConstantTableImpl, ID3DXConstantTable_iface);
@@ -681,7 +687,7 @@ static ULONG WINAPI ID3DXConstantTableImpl_AddRef(ID3DXConstantTable* iface)
return InterlockedIncrement(&This->ref);
}
-static ULONG WINAPI ID3DXConstantTableImpl_Release(ID3DXConstantTable* iface)
+static ULONG WINAPI ID3DXConstantTableImpl_Release(ID3DXConstantTable *iface)
{
ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface);
ULONG ref = InterlockedDecrement(&This->ref);
@@ -690,8 +696,7 @@ static ULONG WINAPI ID3DXConstantTableImpl_Release(ID3DXConstantTable* iface)
if (!ref)
{
- HeapFree(GetProcessHeap(), 0, This->constants);
- HeapFree(GetProcessHeap(), 0, This->ctab);
+ free_constant_table(This);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -1258,8 +1263,7 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD* byte_code,
error:
- HeapFree(GetProcessHeap(), 0, object->constants);
- HeapFree(GetProcessHeap(), 0, object->ctab);
+ free_constant_table(object);
HeapFree(GetProcessHeap(), 0, object);
return hr;
More information about the wine-cvs
mailing list