GStreamer: fix memory leaks.

Many GStreamer objects were not properly managed or never released.

Change-Id: I38b3854e8b9e2264b5b647f331d3bb16b886e2d6
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
This commit is contained in:
Yoann Lopes
2014-03-20 19:20:24 +01:00
committed by The Qt Project
parent 60ba0afbde
commit 023c6ebcb9
20 changed files with 134 additions and 41 deletions

View File

@@ -93,6 +93,9 @@ QGstCodecsInfo::QGstCodecsInfo(QGstCodecsInfo::ElementType elementType)
gst_caps_remove_structure(caps, 0);
}
gst_caps_unref(caps);
gst_caps_unref(allCaps);
#else
Q_UNUSED(elementType);
#endif // GST_CHECK_VERSION(0,10,31)
@@ -143,7 +146,7 @@ GstCaps* QGstCodecsInfo::supportedElementCaps(GstElementFactoryListType elementT
padTemplates = padTemplates->next;
if (padTemplate->direction == padDirection) {
const GstCaps *caps = gst_static_caps_get(&padTemplate->static_caps);
GstCaps *caps = gst_static_caps_get(&padTemplate->static_caps);
for (uint i=0; i<gst_caps_get_size(caps); i++) {
const GstStructure *structure = gst_caps_get_structure(caps, i);
@@ -173,6 +176,7 @@ GstCaps* QGstCodecsInfo::supportedElementCaps(GstElementFactoryListType elementT
gst_caps_merge_structure(res, newStructure);
}
gst_caps_unref(caps);
}
}
}