Ticket #110 (new defect)

Opened 3 years ago

likely_intersection leaks

Reported by: seang Owned by: seang
Priority: major Milestone:
Component: Quadtree Version:
Keywords: memory leak Cc: richard@…

Description

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

_treemodule.c.diff (0.6 KB) - added by seang 3 years ago.

Change History

Changed 3 years ago by seang

Note: See TracTickets for help on using tickets.