Skip to content
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

Weird ref count of Repository obj when access remotes #321

Closed
shinningstar opened this issue Jan 24, 2014 · 1 comment
Closed

Weird ref count of Repository obj when access remotes #321

shinningstar opened this issue Jan 24, 2014 · 1 comment

Comments

@shinningstar
Copy link

image

In method 'refresh', a whole new Repository object has been created and the old one should be deconstructed. But in fact, that not happen. Why?

@jdavid
Copy link
Member

jdavid commented Feb 3, 2014

Thanks for reporting.

This the code I have used to verify this bug is fixed:

from pygit2 import Repository
import sys

if __name__ == '__main__':
    repo = Repository('/home/jdavid/sandboxes/itools/.git')
    print sys.getrefcount(repo)
    repo.remotes
    print sys.getrefcount(repo)

If run with pygit2 v0.20.1 the output is:

2
5

If run with latest checkout of pygit2 the output is:

2
2

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

No branches or pull requests

2 participants