diff options
author | Brian Paul <[email protected]> | 2013-06-24 10:43:16 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-06-24 14:23:54 -0600 |
commit | e3cbb18321b530ab01f57f21b22d38b89efcaec4 (patch) | |
tree | dc168a65eda92fa8109dc25fac8109b3476912b6 /src/gallium/auxiliary/hud/hud_fps.c | |
parent | e5bf19ac1cf28fb588d8caf9397cd3c016737378 (diff) |
gallium/hud: do not use free() for the free_query_data hook
That confuses Gallium's memory debugging code where CALLOC/MALLOC
must be matched with FREE, not free().
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_fps.c')
-rw-r--r-- | src/gallium/auxiliary/hud/hud_fps.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/hud/hud_fps.c b/src/gallium/auxiliary/hud/hud_fps.c index 80381f54713..6e9be712b66 100644 --- a/src/gallium/auxiliary/hud/hud_fps.c +++ b/src/gallium/auxiliary/hud/hud_fps.c @@ -60,6 +60,12 @@ query_fps(struct hud_graph *gr) } } +static void +free_query_data(void *p) +{ + FREE(p); +} + void hud_fps_graph_install(struct hud_pane *pane) { @@ -76,7 +82,11 @@ hud_fps_graph_install(struct hud_pane *pane) } gr->query_new_value = query_fps; - gr->free_query_data = free; + + /* Don't use free() as our callback as that messes up Gallium's + * memory debugger. Use simple free_query_data() wrapper. + */ + gr->free_query_data = free_query_data; hud_pane_add_graph(pane, gr); } |