gallium/hud: fix a problem where objects are free'd while in use.
[mesa.git] / src / gallium / auxiliary / hud / hud_diskstat.c
index a2290cc428e86ece593036ef0273dadb7e045f25..7d4f5001a3de425c9098a2c3316a6d1fdd155494 100644 (file)
@@ -46,8 +46,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#define LOCAL_DEBUG 0
-
 struct stat_s
 {
    /* Read */
@@ -164,14 +162,6 @@ query_dsi_load(struct hud_graph *gr)
    }
 }
 
-static void
-free_query_data(void *p)
-{
-   struct diskstat_info *nic = (struct diskstat_info *) p;
-   list_del(&nic->list);
-   FREE(nic);
-}
-
 /**
   * Create and initialize a new object for a specific block I/O device.
   * \param  pane  parent context.
@@ -189,12 +179,6 @@ hud_diskstat_graph_install(struct hud_pane *pane, const char *dev_name,
    if (num_devs <= 0)
       return;
 
-#if LOCAL_DEBUG
-   printf("%s(%s, %s) - Creating HUD object\n", __func__, dev_name,
-          mode == DISKSTAT_RD ? "RD" :
-          mode == DISKSTAT_WR ? "WR" : "UNDEFINED");
-#endif
-
    dsi = find_dsi_by_name(dev_name, mode);
    if (!dsi)
       return;
@@ -216,11 +200,6 @@ hud_diskstat_graph_install(struct hud_pane *pane, const char *dev_name,
    gr->query_data = dsi;
    gr->query_new_value = query_dsi_load;
 
-   /* 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);
    hud_pane_set_max_value(pane, 100);
 }