Skip to content

Remote leak fix - #981

Merged
johnhaley81 merged 4 commits into
nodegit:masterfrom
srajko:remote-leak-fix
Apr 7, 2016
Merged

Remote leak fix#981
johnhaley81 merged 4 commits into
nodegit:masterfrom
srajko:remote-leak-fix

Conversation

@srajko

@srajko srajko commented Apr 1, 2016

Copy link
Copy Markdown
Collaborator

Makes remotes self-freeing.

I needed to add new functionality for https://libgit2.github.com/libgit2/#HEAD/group/remote/git_remote_get_refspec, because the returned refspec belongs to the remote (and gets freed with it), but there is no way to duplicate the refspec (it is an opaque struct). AFAICT this requires an ownership mechanism, allowing the refspec to keep a handle on its owner remote so it doesn't get freed.

So I extended shouldDuplicate into ownedByThis: when ownedByThis is turned on we duplicate if the type has a dupFunction, otherwise we keep a handle on the owner.

@srajko
srajko force-pushed the remote-leak-fix branch from d53ef9a to 416d47f Compare April 2, 2016 00:22
@srajko
srajko force-pushed the remote-leak-fix branch from de19722 to f4c39d7 Compare April 7, 2016 16:59
Increase timeout, use a nodegit test repo, and pass oid instead of object returned by peel
@srajko
srajko force-pushed the remote-leak-fix branch from c7109ed to 6580ecb Compare April 7, 2016 17:38
@johnhaley81

Copy link
Copy Markdown
Collaborator

Thanks @srajko!

@johnhaley81
johnhaley81 merged commit d912b6c into nodegit:master Apr 7, 2016
@johnhaley81
johnhaley81 deleted the remote-leak-fix branch April 7, 2016 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants