mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
qtitem: don't potentially leak a large number of buffers
The only other place where these queued buffers are removed, is in setCaps() but that is not called at all on shutdown so this list of buffers could not be removed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1004>
This commit is contained in:
parent
be83a52db9
commit
fbf60a61a0
1 changed files with 11 additions and 0 deletions
|
@ -141,6 +141,8 @@ QtGLVideoItem::QtGLVideoItem()
|
|||
|
||||
QtGLVideoItem::~QtGLVideoItem()
|
||||
{
|
||||
GstBuffer *tmp_buffer;
|
||||
|
||||
/* Before destroying the priv info, make sure
|
||||
* no qmlglsink's will call in again, and that
|
||||
* any ongoing calls are done by invalidating the proxy
|
||||
|
@ -157,6 +159,15 @@ QtGLVideoItem::~QtGLVideoItem()
|
|||
if (this->priv->display)
|
||||
gst_object_unref(this->priv->display);
|
||||
|
||||
while ((tmp_buffer = (GstBuffer*) g_queue_pop_head (&this->priv->potentially_unbound_buffers))) {
|
||||
GST_TRACE ("old buffer %p should be unbound now, unreffing", tmp_buffer);
|
||||
gst_buffer_unref (tmp_buffer);
|
||||
}
|
||||
while ((tmp_buffer = (GstBuffer*) g_queue_pop_head (&this->priv->bound_buffers))) {
|
||||
GST_TRACE ("old buffer %p should be unbound now, unreffing", tmp_buffer);
|
||||
gst_buffer_unref (tmp_buffer);
|
||||
}
|
||||
|
||||
gst_buffer_replace (&this->priv->buffer, NULL);
|
||||
|
||||
gst_caps_replace (&this->priv->caps, NULL);
|
||||
|
|
Loading…
Reference in a new issue