That confuses Gallium's memory debugging code where CALLOC/MALLOC
must be matched with FREE, not free().
Reviewed-by: Marek Olšák <maraeo@gmail.com>
}
}
+static void
+free_query_data(void *p)
+{
+ FREE(p);
+}
+
void
hud_cpu_graph_install(struct hud_pane *pane, unsigned cpu_index)
{
}
gr->query_new_value = query_cpu_load;
- 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;
info = gr->query_data;
info->cpu_index = cpu_index;
}
}
+static void
+free_query_data(void *p)
+{
+ FREE(p);
+}
+
void
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);
}
char name[128];
void *query_data;
void (*query_new_value)(struct hud_graph *gr);
- void (*free_query_data)(void *ptr);
+ void (*free_query_data)(void *ptr); /**< do not use ordinary free() */
/* mutable variables */
unsigned num_vertices;