Skip to content

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

Closed
shinningstar wants to merge 1 commit into
libgit2:masterfrom
shinningstar:master
Closed

[Fixbug]: Repository object reference count increase abnormal#328
shinningstar wants to merge 1 commit into
libgit2:masterfrom
shinningstar:master

Conversation

@shinningstar

Copy link
Copy Markdown

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

xtao commented Jan 27, 2014

Copy link
Copy Markdown
Contributor

LGTM :-)

@carlosmn

Copy link
Copy Markdown
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

jdavid commented Jan 28, 2014

Copy link
Copy Markdown
Member

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

xtao commented Jan 29, 2014

Copy link
Copy Markdown
Contributor

Please review #332 , thanks.

@jdavid

jdavid commented Jan 29, 2014

Copy link
Copy Markdown
Member

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