From 0113029fb98ea09de7d3ba978fec4672f137cd0e Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Wed, 5 Aug 2015 11:56:32 +0100 Subject: [PATCH] opencv: facedetect: free IplImage with cvReleaseImage Using delete() with IplImage will fail to free some of the structure's contents. cvReleaseImage() is the proper way of freeing the memory. --- ext/opencv/gstfacedetect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/opencv/gstfacedetect.cpp b/ext/opencv/gstfacedetect.cpp index 12c6f4cfa9..3afd72c58d 100644 --- a/ext/opencv/gstfacedetect.cpp +++ b/ext/opencv/gstfacedetect.cpp @@ -223,7 +223,7 @@ gst_face_detect_finalize (GObject * obj) GstFaceDetect *filter = GST_FACE_DETECT (obj); if (filter->cvGray) - delete (&filter->cvGray); + cvReleaseImage(&filter->cvGray); if (filter->cvStorage) cvReleaseMemStorage (&filter->cvStorage); @@ -501,7 +501,7 @@ gst_face_detect_set_caps (GstOpencvVideoFilter * transform, gint in_width, filter = GST_FACE_DETECT (transform); if (filter->cvGray) - delete (&filter->cvGray); + cvReleaseImage(&filter->cvGray); filter->cvGray = cvCreateImage (cvSize (in_width, in_height), IPL_DEPTH_8U, 1);