Skip to content

Commit 8927e23

Browse files
authored
Merge pull request #680 from yori/fix-branch-iterator-leak
Free the branch iterator
2 parents fb31e47 + cdac507 commit 8927e23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ObjectiveGit/GTRepository.m

+4
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ - (BOOL)enumerateBranchesWithType:(GTBranchType)type error:(NSError **)error usi
407407
if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
408408
return NO;
409409
}
410+
411+
@onExit {
412+
git_branch_iterator_free(iter);
413+
};
410414

411415
git_branch_t branchType;
412416
while ((gitError = git_branch_next(&gitRef, &branchType, iter)) == GIT_OK) {

0 commit comments

Comments
 (0)