OpenCV Mat creation memory leak
- by Royi Freifeld
My memory is getting full fairly quick once using the next piece of code. Valgrind shows a memory leak, but everything is allocated on stack and (supposed to be) freed once the function ends.
void mult_run_time(int rows, int cols)
{
Mat matrix(rows,cols,CV_32SC1);
Mat row_vec(cols,1,CV_32SC1);
/* initialize vector and matrix */
…