* Still not quite right:
[scdataviz] / matdb.c
diff --git a/matdb.c b/matdb.c
index 891bec5..995074c 100644 (file)
--- a/matdb.c
+++ b/matdb.c
@@ -51,13 +51,19 @@ void destroy_bowing_gpointer(gpointer data) {
   destroy_bowing((struct matdb_bowing *)data);
 }
 void destroy_material(struct matdb_material *mat) {
-  free(mat->name);
+  #ifdef DEBUG
+  fprintf(stderr, "destroy_material\n");
+  #endif
+  g_string_free(mat->name, TRUE);
   g_hash_table_unref(mat->properties);
   free(mat);
 }
 void destroy_bowing(struct matdb_bowing *bow) {
-  free(bow->from);
-  free(bow->to);
+  #ifdef DEBUG
+  fprintf(stderr, "destroy_bowing\n");
+  #endif
+  g_string_free(bow->from, TRUE);
+  g_string_free(bow->to, TRUE);
   g_hash_table_unref(bow->properties);
   free(bow);
 }