Fix memory leak in 'wrap_index_entry' (issue #18)
This commit is contained in:
1
pygit2.c
1
pygit2.c
@@ -1655,7 +1655,6 @@ wrap_index_entry(git_index_entry *entry, Index *index) {
|
|||||||
|
|
||||||
py_entry->entry = entry;
|
py_entry->entry = entry;
|
||||||
|
|
||||||
Py_INCREF(py_entry);
|
|
||||||
return (PyObject*)py_entry;
|
return (PyObject*)py_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
import unittest
|
|
||||||
|
|
||||||
import utils
|
|
||||||
|
|
||||||
class TestLeak(utils.RepoTestCase):
|
|
||||||
def test_index_iter(self):
|
|
||||||
index = self.repo.index
|
|
||||||
while True:
|
|
||||||
list(index)
|
|
||||||
|
|
||||||
def test_index_getitem(self):
|
|
||||||
index = self.repo.index
|
|
||||||
while True:
|
|
||||||
index[0]
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
Reference in New Issue
Block a user