Store only strings in values' values. g_strdup these strings. Even if

2006-04-04  Benoît Dejean  <benoit@placenet.org>

	* sysinfo.c: (init_sysinfo):

	Store only strings in values' values. g_strdup these strings.
	Even if values is never destroyed, set key_destroy_func to NULL.

	Leave description to NULL.
This commit is contained in:
Benoît Dejean
2006-04-04 21:23:46 +00:00
committed by Benoît Dejean
parent 80855eabe2
commit afa9757a0e
2 changed files with 15 additions and 8 deletions

View File

@@ -1,3 +1,12 @@
2006-04-04 Benoît Dejean <benoit@placenet.org>
* sysinfo.c: (init_sysinfo):
Store only strings in values' values. g_strdup these strings.
Even if values is never destroyed, set key_destroy_func to NULL.
Leave description to NULL.
2006-04-04 Julio M. Merino Vidal <jmmv@NetBSD.org>
* sysdeps/freebsd/Makefile.am:

View File

@@ -63,21 +63,19 @@ init_sysinfo (glibtop *server)
cpuinfo->values = g_hash_table_new_full(g_str_hash,
g_str_equal,
g_free, g_free);
cpuinfo->descriptions = g_hash_table_new_full(g_str_hash,
g_str_equal,
g_free, g_free);
NULL, g_free);
g_ptr_array_add (cpuinfo->labels, "processor");
g_hash_table_insert (cpuinfo->values, "processor",
&sysinfo.ncpu);
g_strdup_printf("%u", (guint)sysinfo.ncpu));
g_ptr_array_add (cpuinfo->labels, "vendor_id");
g_hash_table_insert (cpuinfo->values, "vendor_id", model);
g_hash_table_insert (cpuinfo->values, "vendor_id",
g_strdup(model));
g_ptr_array_add (cpuinfo->labels, "cpu MHz");
g_hash_table_insert (cpuinfo->values, "cpu MHz", &mhz);
g_hash_table_insert (cpuinfo->values, "cpu MHz",
g_strdup_printf("%d", mhz));
}
g_free (model);