8000 GTRepository dealloc crash · Issue #689 · libgit2/objective-git · GitHub
[go: up one dir, main page]

Skip to content
GTRepository dealloc crash #689
Open
@arguiot

Description

@arguiot

When the system calls -[GTRepository dealloc] and the git_repository is empty, but still exists, the app crashes.

Here is a screenshot of the debug session:
Capture d’écran 2019-05-16 à 20 27 09

What I would suggest is to change:

- (void)dealloc {
if (_git_repository != NULL) {
git_repository_free(_git_repository);
_git_repository = NULL;
}
}

By simply checking if the workdir property of the git_repository object isn't empty before cleaning the repo.

I'm not an Objective-C developer, so I let you guys do that for me (or just show me how to do it, and I'll submit a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0