Leaking of C++ objects if they are constructed with a python function
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
Issue description
C++ objects that take a python function as argument are not properly deleted. The issue seems to be that the Python garbage collector cannot break the reference cycle. I hope the example code illustrates the issue well. If there are any questions, you can also find me in the gitter.
Reproducible example code
yeganer/pybind11@d27b39e15d543fd8207d047ff1fe9fab52d9b440:test
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducible example referenced at yeganer/pybind11@d27b39e15d543fd8207d047ff1fe9fab52d9b440:test, then inspect the related binding and ownership behavior in the repository. Confirm the failure involves Python garbage collection and reference cycles, and consider the issue done when the example no longer leaks constructed C++ objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100