lua---opencv icon indicating copy to clipboard operation
lua---opencv copied to clipboard

Memory leak in warpAffine

Open Junonia opened this issue 10 years ago • 1 comments

I think there is a bug generic/opencv.c, in function

static int libopencv_(Main_cvWarpAffine) (lua_State *L) {

At the end,

cvReleaseImage(&source_ipl); cvReleaseImage(&dest_ipl);

should be used to release all the memory. Otherwise, memory will keep increasing.

Junonia avatar Feb 07 '15 19:02 Junonia

That fix works but you have to delete the lines:

cvReleaseImageHeader(&source_ipl); cvReleaseImageHeader(&dest_ipl);

from the function or else your fix won't work. I also had to delete all the CMake generated files and rebuild from scratch for it to successfully fix the memory leak.

harrisonzhao avatar Feb 13 '15 18:02 harrisonzhao