]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
c++ Hough API memory leak fixed
authorbi11 <bi11@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Thu, 25 Mar 2010 05:06:34 +0000 (05:06 +0000)
committerbi11 <bi11@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Thu, 25 Mar 2010 05:06:34 +0000 (05:06 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2905 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/src/cv/cvhough.cpp

index 23c75731c4210a3f53625a44a44aecd704cad684..90852bca1846fa11b96b1b39184c950f12d426bb 100644 (file)
@@ -1090,6 +1090,7 @@ void HoughLines( const Mat& image, vector<Vec2f>& lines,
                     CV_HOUGH_STANDARD : CV_HOUGH_MULTI_SCALE,\r
                     rho, theta, threshold, srn, stn );\r
     Seq<Vec2f>(seq).copyTo(lines);\r
+       cvReleaseMemStorage(&storage);\r
 }\r
 \r
 void HoughLinesP( Mat& image, vector<Vec4i>& lines,\r
@@ -1101,6 +1102,7 @@ void HoughLinesP( Mat& image, vector<Vec4i>& lines,
     CvSeq* seq = cvHoughLines2( &_image, storage, CV_HOUGH_PROBABILISTIC,\r
                     rho, theta, threshold, minLineLength, maxGap );\r
     Seq<Vec4i>(seq).copyTo(lines);\r
+       cvReleaseMemStorage(&storage);\r
 }\r
 \r
 void HoughCircles( const Mat& image, vector<Vec3f>& circles,\r
@@ -1113,6 +1115,7 @@ void HoughCircles( const Mat& image, vector<Vec3f>& circles,
     CvSeq* seq = cvHoughCircles( &_image, storage, method,\r
                     dp, min_dist, param1, param2, minRadius, maxRadius );\r
     Seq<Vec3f>(seq).copyTo(circles);\r
+       cvReleaseMemStorage(&storage);\r
 }\r
 \r
 }\r