aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2023-06-06 11:07:17 +0200
committerMarvin Borner2023-06-06 11:07:17 +0200
commit4b5200630ad55d2fd84ab71ad766fea81b1eaafe (patch)
treeb270fb80fb1fc6f1ad6256a288fc1417c0704899
parent1791631a3e2911afe70bf124452686e9cc9f3b06 (diff)
Fixed some dumb bugs
-rw-r--r--src/map.c4
-rw-r--r--src/term.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/map.c b/src/map.c
index 9f6a050..c36354d 100644
--- a/src/map.c
+++ b/src/map.c
@@ -13,7 +13,7 @@ static struct hashmap *all_terms;
static void hashmap_free_term(void *item)
{
struct term *term = *(struct term **)item;
- free(term);
+ term_destroy_head(term);
}
struct hashmap *map_all_terms(void)
@@ -31,7 +31,7 @@ struct term *map_get(struct hashmap *map, hash_t hash)
void map_set(struct hashmap *map, struct term *term)
{
- if (!hashmap_get(map, term->hash))
+ if (map == all_terms && !hashmap_get(map, term->hash))
schedule_add(term); // also add to schedule
hashmap_set(map, &term, term->hash);
}
diff --git a/src/term.c b/src/term.c
index f4bee23..bf712d6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -198,6 +198,7 @@ void term_rehash_parents(struct term *term)
struct parent_list *next = iterator->next;
free(iterator);
iterator = next;
+ continue;
}
map_delete(term->parents, parent);