Skip to content

[Fixbug]: Repository object reference count increase abnormal #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

shinningstar
Copy link

For issue #326, Repository object's reference count will be increased abnormally by it's remotes getter function. That is because 'py_args' does not release which hold 1 reference to repository.
This issue stem from my requirement to dealloc repository object for purpose of releasing file descriptor resource occupied by it. When I construct a new repository object, I found that the old one won't be deconstructed since it's reference count can't decrease to zero.

@xtao
Copy link
Contributor

xtao commented Jan 27, 2014

LGTM :-)

@carlosmn
Copy link
Member

While this does fix the issue with the current code, I wonder if we shouldn't get rid of the BuildValue() call completely. We don't allow the user to create a Remote instance, so we don't need to call Remote_init() as the runtime would, and we can simply use a wrap_remote() function, similar to the other types without a constructor, that takes in the Repository* and string directly.

@jdavid
Copy link
Member

jdavid commented Jan 28, 2014

yes that would be better, actually I think it would read something like:

wrap_remote(Repository *repo, git_remote *remote)

so we can refactor the code with Repository_create_remote

@xtao
Copy link
Contributor

xtao commented Jan 29, 2014

Please review #332 , thanks.

@jdavid
Copy link
Member

jdavid commented Jan 29, 2014

okey merged #332 instead

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.

4 participants