Ticket #110 (defect)
Opened 2 years ago
likely_intersection leaks
Status: new
| Reported by: | seang | Assigned to: | seang |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Quadtree | Version: | |
| Keywords: | memory leak | Cc: | richard@ncogni.to |
Hi,
I have been using your quadtree module with much success, however, each call to likely_intersection caused an increase in memory usage. Since I make >1 million calls to this function, well it wasn't good!
I tracked it down to the likely_intersection function. I'm not a Python/C-binding wizard, but I think the reference count of the list wrapped by the sequence iterator needed to be decremented by one. Additionally, I added a free(hits) line to stop another leak.
Please see the attached patch. I've tested it on win32 with Python 2.5 and the memory use is rock solid now.
Attachments
Change History
05/08/07 08:52:12: Modified by seang
- attachment _treemodule.c.diff added.
