From 2906023190f525a56a37c0549936cabfb38323d3 Mon Sep 17 00:00:00 2001 From: Victor Erukhimov Date: Fri, 16 Jul 2010 12:59:47 +0000 Subject: [PATCH] Fixed a memory leak --- samples/c/squares.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/c/squares.c b/samples/c/squares.c index 9a5e7cef7..82c5d6100 100644 --- a/samples/c/squares.c +++ b/samples/c/squares.c @@ -49,7 +49,6 @@ CvSeq* findSquares4( IplImage* img, CvMemStorage* storage ) // create empty sequence that will contain points - // 4 points per square (the square's vertices) CvSeq* squares = cvCreateSeq( 0, sizeof(CvSeq), sizeof(CvPoint), storage ); - // select the maximum ROI in the image // with the width and height divisible by 2 cvSetImageROI( timg, cvRect( 0, 0, sz.width, sz.height )); @@ -221,6 +220,8 @@ int main(int argc, char** argv) } cvDestroyWindow( wndname ); + + cvReleaseMemStorage(&storage); return 0; }