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.
This commit is contained in:
Luis de Bethencourt 2015-08-05 11:56:32 +01:00
parent cc8af753b9
commit 0113029fb9

View file

@ -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);