mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
edgedetect: Don't leak cvImages when caps are changing or the element is reused
This commit is contained in:
parent
45ac4ba663
commit
48e95f3d6f
1 changed files with 7 additions and 0 deletions
|
@ -270,6 +270,13 @@ gst_edge_detect_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||
gst_structure_get_int (structure, "width", &width);
|
||||
gst_structure_get_int (structure, "height", &height);
|
||||
|
||||
if (filter->cvImage != NULL) {
|
||||
cvReleaseImage (&filter->cvImage);
|
||||
cvReleaseImage (&filter->cvCEdge);
|
||||
cvReleaseImage (&filter->cvGray);
|
||||
cvReleaseImage (&filter->cvEdge);
|
||||
}
|
||||
|
||||
filter->cvImage = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 3);
|
||||
filter->cvCEdge = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 3);
|
||||
filter->cvGray = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 1);
|
||||
|
|
Loading…
Reference in a new issue