Commit 29060231 authored by Victor Erukhimov's avatar Victor Erukhimov

Fixed a memory leak

parent f78a3b4c
...@@ -49,7 +49,6 @@ CvSeq* findSquares4( IplImage* img, CvMemStorage* storage ) ...@@ -49,7 +49,6 @@ CvSeq* findSquares4( IplImage* img, CvMemStorage* storage )
// create empty sequence that will contain points - // create empty sequence that will contain points -
// 4 points per square (the square's vertices) // 4 points per square (the square's vertices)
CvSeq* squares = cvCreateSeq( 0, sizeof(CvSeq), sizeof(CvPoint), storage ); CvSeq* squares = cvCreateSeq( 0, sizeof(CvSeq), sizeof(CvPoint), storage );
// select the maximum ROI in the image // select the maximum ROI in the image
// with the width and height divisible by 2 // with the width and height divisible by 2
cvSetImageROI( timg, cvRect( 0, 0, sz.width, sz.height )); cvSetImageROI( timg, cvRect( 0, 0, sz.width, sz.height ));
...@@ -221,6 +220,8 @@ int main(int argc, char** argv) ...@@ -221,6 +220,8 @@ int main(int argc, char** argv)
} }
cvDestroyWindow( wndname ); cvDestroyWindow( wndname );
cvReleaseMemStorage(&storage);
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment