From 8c79a7e335a62c2e673c09f2a62412679e072f61 Mon Sep 17 00:00:00 2001 From: Arthur Guiot Date: Thu, 16 May 2019 20:37:28 +0800 Subject: [PATCH] Fixes crash described by #689 --- ObjectiveGit/GTRepository.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ObjectiveGit/GTRepository.m b/ObjectiveGit/GTRepository.m index 133216cd4..b49a2940e 100644 --- a/ObjectiveGit/GTRepository.m +++ b/ObjectiveGit/GTRepository.m @@ -108,10 +108,10 @@ - (BOOL)isEqual:(GTRepository *)repo { } - (void)dealloc { - if (_git_repository != NULL) { + if (_git_repository != NULL && _git_repository.workdir != NULL) { git_repository_free(_git_repository); - _git_repository = NULL; } + _git_repository = NULL; } #pragma mark API