diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2014-03-20 19:20:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-21 19:16:09 +0100 |
commit | 023c6ebcb9d990042f0e9a750fd6238d22001022 (patch) | |
tree | b98e068ccbdae0a587179d657541cc857c9daf0c /src/gsttools/qgstcodecsinfo.cpp | |
parent | 60ba0afbde0ef53a12afb6c755ca6fd64aabf5da (diff) |
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>
Diffstat (limited to 'src/gsttools/qgstcodecsinfo.cpp')
-rw-r--r-- | src/gsttools/qgstcodecsinfo.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gsttools/qgstcodecsinfo.cpp b/src/gsttools/qgstcodecsinfo.cpp index ade79fd44..6db9b016a 100644 --- a/src/gsttools/qgstcodecsinfo.cpp +++ b/src/gsttools/qgstcodecsinfo.cpp @@ -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); } } } |