Memory leak in cv.Moments. A patch (Feature #688)


Added by Daniele Paganelli over 14 years ago. Updated about 14 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:James Bowman % Done:

0%

Category:python bindings
Target version:-
Difficulty: Pull request:

Description

In the pycvMoments function of the generated0.i code, the cvarrseq arr is created, filled with converted values from the arguments of the function, used to compute the moments, but never deleted.
This causes a severe memory leak when running cv.Moments (because the arr structure will never be deleted anywhere).
I quickly patched the gen.py file in order to call cvReleaseData(arr) before returning the results to python, only for the pycvMoments function generation.
Don't know if other functions are affected.

Tested in 3947 (currently latest_stable_snapshot).


memleak688.diff - the cvarrseq arr MUST be released before exiting pycvMoments (658 Bytes) Daniele Paganelli, 2010-11-18 06:15 pm


Associated revisions

Revision 2c9f6512
Added by Andrey Kamaev almost 12 years ago

Merge pull request #688 from jet47:fix-nonfree-compilation

History

Updated by Vadim Pisarevsky over 14 years ago

  • Status deleted (Open)

Updated by James Bowman about 14 years ago

Thanks, fixed in r4556.

  • Status set to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF