Skip to content

Commit 8c79a7e

Browse files
authored
Fixes crash described by libgit2#689
1 parent 3668183 commit 8c79a7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ObjectiveGit/GTRepository.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ - (BOOL)isEqual:(GTRepository *)repo {
108108
}
109109

110110
- (void)dealloc {
111-
if (_git_repository != NULL) {
111+
if (_git_repository != NULL && _git_repository.workdir != NULL) {
112112
git_repository_free(_git_repository);
113-
_git_repository = NULL;
114113
}
114+
_git_repository = NULL;
115115
}
116116

117117
#pragma mark API

0 commit comments

Comments
 (0)