Commit 6aced396 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

d3dx9: Avoid double freeing samplers.

parent c799c1ea
...@@ -516,8 +516,7 @@ static void free_sampler(struct d3dx_sampler *sampler) ...@@ -516,8 +516,7 @@ static void free_sampler(struct d3dx_sampler *sampler)
{ {
free_state(&sampler->states[i]); free_state(&sampler->states[i]);
} }
HeapFree(GetProcessHeap(), 0, sampler->states); heap_free(sampler->states);
HeapFree(GetProcessHeap(), 0, sampler);
} }
static void d3dx_pool_release_shared_parameter(struct d3dx_top_level_parameter *param); static void d3dx_pool_release_shared_parameter(struct d3dx_top_level_parameter *param);
...@@ -531,7 +530,7 @@ static void free_parameter_data(struct d3dx_parameter *param, BOOL child) ...@@ -531,7 +530,7 @@ static void free_parameter_data(struct d3dx_parameter *param, BOOL child)
switch (param->type) switch (param->type)
{ {
case D3DXPT_STRING: case D3DXPT_STRING:
HeapFree(GetProcessHeap(), 0, *(char **)param->data); heap_free(*(char **)param->data);
break; break;
case D3DXPT_TEXTURE: case D3DXPT_TEXTURE:
...@@ -557,8 +556,8 @@ static void free_parameter_data(struct d3dx_parameter *param, BOOL child) ...@@ -557,8 +556,8 @@ static void free_parameter_data(struct d3dx_parameter *param, BOOL child)
break; break;
} }
} }
if (!child) if (!child || is_param_type_sampler(param->type))
HeapFree(GetProcessHeap(), 0, param->data); heap_free(param->data);
} }
static void free_parameter(struct d3dx_parameter *param, BOOL element, BOOL child) static void free_parameter(struct d3dx_parameter *param, BOOL element, BOOL child)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment