-/* Called at program exit.
- *
- * This is similar to metrics_info_fini, but only frees any used
- * memory. Notably, it does not call any OpenGL functions, (since the
- * OpenGL context no longer exists at program exit).
- */
-static void
-metrics_exit (void)
-{
- context_t *ctx = context_get_current ();
- metrics_t *metrics = ctx->metrics;
- metrics_info_t *info = metrics->info;
- unsigned i, j;
- timer_query_t *timer, *timer_next;
- monitor_t *monitor, *monitor_next;
-
- if (verbose)
- printf ("fips: terminating\n");
-
- if (! info->initialized)
- return;
-
- for (timer = metrics->timer_head;
- timer;
- timer = timer_next)
- {
- timer_next = timer->next;
- free (timer);
- }
-
- for (monitor = metrics->monitor_head;
- monitor;
- monitor = monitor_next)
- {
- monitor_next = monitor->next;
- free (monitor);
- }
-
- for (i = 0; i < info->num_groups; i++) {
- metrics_group_info_t *group = &info->groups[i];
-
- for (j = 0; j < group->num_counters; i++)
- free (group->counter_names[j]);
-
- free (group->counter_types);
- free (group->counter_names);
- free (group->counter_ids);
-
- free (group->name);
- }
-
- free (info->groups);
-
- for (i = 0; i < info->num_shader_stages; i++)
- free (info->stages[i].name);
-
- free (info->stages);
-}
-