<div dir="ltr">I am developing an application that needs to create and remove the pipeline repeatedly. When I do this the memory of the application grows and grows, it never decreases. Even after 10 repetitions I remove all the pipeline and call gst_deinit and it is not released. This is the code:<br>void GstVideo::createPipeline()<br>    m_pipeline = ("filesrc location=/media/datos/video.mp4 ! qtdemux ! avdec_h264 ! videoconvert ! video/x-raw,format=RGB ! appsink name=appsink");<br>    if(!err)<br>    {<br>        GstElement* sink = gst_bin_get_by_name((GstBin*)m_pipeline, "appsink");<br>        gst_app_sink_set_emit_signals(GST_APP_SINK(sink), TRUE);<br>        gst_app_sink_set_max_buffers(GST_APP_SINK(sink), 1);<br>        gst_app_sink_set_drop(GST_APP_SINK(sink), TRUE);<br>        g_signal_connect(sink, "new-sample", G_CALLBACK(GstVideo::newSample), (gpointer)this);<br>        g_signal_connect(sink, "eos", G_CALLBACK(GstVideo::eos), (gpointer)this);<br>    }<br>    else<br>    {<br>        g_error_free(err);<br>    }<br>}<br><br><br>GstFlowReturn GstVideo::newSample(GstAppSink *sink, gpointer user_data)<br>{<br>    GstSample* sinkSample = gst_app_sink_pull_sample(GST_APP_SINK(sink));<br>    if(sinkSample) {<br>    GstMapInfo info;<br>    GstBuffer* buffer  = gst_sample_get_buffer(sinkSample);<br>    gst_buffer_map(buffer, &info, GST_MAP_READ);<br>    GstCaps *caps = gst_sample_get_caps(sinkSample);<br>    GstStructure * structure = gst_caps_get_structure(caps, 0);<br><br>    [...]<br><br>    gst_buffer_unmap(buffer, &info);<br>    gst_sample_unref(sinkSample);<br>    }<br>    return GST_FLOW_OK;<br>}<br><br>GstVideo::~GstVideo()<br>{<br>    if(m_pipeline) {<br>        gst_element_set_state(m_pipeline, GST_STATE_NULL);<br>        gst_object_unref( m_pipeline);<br>    }<br><br></div>