Skip to content

Conversation

carlosmn
Copy link
Member

We are allowed to call git_repository__cleanup multiple times, and this happens e.g. in rugged if we want to free up resources before GC gets around to them.

This means that we cannot leave dangling pointers in it, which we were doing with the grafts. Fix this by setting the pointers to NULL after freeing the resources.


I discovered this while working on libgit2/rugged#964 trying to update the bindings.

We are allowed to call `git_repository__cleanup` multiple times, and this
happens e.g. in rugged if we want to free up resources before GC gets around to
them.

This means that we cannot leave dangling pointers in it, which we were doing
with the grafts. Fix this by setting the pointers to NULL after freeing the resources.
@ethomson ethomson merged commit 9903482 into main Jul 18, 2023
@ethomson ethomson deleted the cmn/clear-graft-pointers branch July 18, 2023 13:36
@ethomson ethomson added the v1.7 label Jul 18, 2023
@ethomson ethomson mentioned this pull request Aug 2, 2023
@ethomson ethomson added the bug label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants