diff options
| author | Vicent Marti <tanoku@gmail.com> | 2010-07-10 12:14:30 -0700 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2010-07-10 12:14:30 -0700 |
| commit | 58b0cbea74c160c61ec70768568e150c4d31f633 (patch) | |
| tree | 74766fd92581310d08c6faff6998dbf307800282 /src/revwalk.c | |
| parent | 3cd8b687d5dc8006a5eae9e9c4dac212e8df67d1 (diff) | |
| download | libgit2-58b0cbea74c160c61ec70768568e150c4d31f633.tar.gz | |
Actually free all commits when freeing a commit pool
Previously the objects table was being freed, but not
the actuall commits. All git_commit objects are freed
and hence invalidated when freeing the git_rp object
they belong to.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/revwalk.c')
| -rw-r--r-- | src/revwalk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/revwalk.c b/src/revwalk.c index 5d7f65df6..c3b53a351 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -45,9 +45,18 @@ git_revpool *gitrp_alloc(git_odb *db) void gitrp_free(git_revpool *walk) { + git_commit *commit; + git_revpool_tableit it; + git_commit_list_clear(&(walk->iterator), 0); git_commit_list_clear(&(walk->roots), 0); + git_revpool_tableit_init(walk->commits, &it); + + while ((commit = (git_commit *)git_revpool_tableit_next(&it)) != NULL) { + free(commit); + } + git_revpool_table_free(walk->commits); free(walk); |
