diff options
author | Brian Paul <[email protected]> | 2014-04-09 19:22:11 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2014-04-10 07:53:05 -0600 |
commit | f9985db0bc1f1fa217a0fa30a608cb78ccd79a50 (patch) | |
tree | 0bf457ffdba3a7a09c4154d1fd0784727964f802 /src/mesa/state_tracker/st_texture.c | |
parent | 87502bbcd7311a7eecb5a9ef82b4770253a62530 (diff) |
st/mesa: fix sampler_view REALLOC/FREE macro mix-up
We were using REALLOC() from u_memory.h but FREE() from imports.h.
This mismatch caused us to trash the heap on Windows after we
deleted a texture object.
This fixes a regression from commit 6c59be7776e4d.
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 8d559dfcdfd..cfa0605ca2b 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -483,3 +483,15 @@ st_texture_release_all_sampler_views(struct st_texture_object *stObj) for (i = 0; i < stObj->num_sampler_views; ++i) pipe_sampler_view_reference(&stObj->sampler_views[i], NULL); } + + +void +st_texture_free_sampler_views(struct st_texture_object *stObj) +{ + /* NOTE: + * We use FREE() here to match REALLOC() above. Both come from + * u_memory.h, not imports.h. If we mis-match MALLOC/FREE from + * those two headers we can trash the heap. + */ + FREE(stObj->sampler_views); +} |