lua---opencv
lua---opencv copied to clipboard
Memory leak in warpAffine
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.
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.