free(mailmap);
}
+static void release_revisions_topo_walk_info(struct topo_walk_info *info);
+
void release_revisions(struct rev_info *revs)
{
free_commit_list(revs->commits);
free_grep_patterns(&revs->grep_filter);
diff_free(&revs->pruning);
reflog_walk_info_release(revs->reflog_info);
+ release_revisions_topo_walk_info(revs->topo_walk_info);
}
static void add_child(struct rev_info *revs, struct commit *parent, struct commit *child)
indegree_walk_step(revs);
}
-static void reset_topo_walk(struct rev_info *revs)
+static void release_revisions_topo_walk_info(struct topo_walk_info *info)
{
- struct topo_walk_info *info = revs->topo_walk_info;
-
+ if (!info)
+ return;
clear_prio_queue(&info->explore_queue);
clear_prio_queue(&info->indegree_queue);
clear_prio_queue(&info->topo_queue);
clear_indegree_slab(&info->indegree);
clear_author_date_slab(&info->author_date);
+ free(info);
+}
- FREE_AND_NULL(revs->topo_walk_info);
+static void reset_topo_walk(struct rev_info *revs)
+{
+ release_revisions_topo_walk_info(revs->topo_walk_info);
+ revs->topo_walk_info = NULL;
}
static void init_topo_walk(struct rev_info *revs)