wpe: free a previous pending image/shm buffer

Don't blindly overwrite a possibly previously set buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1663>
This commit is contained in:
Matthew Waters 2020-10-02 12:06:59 +10:00 committed by GStreamer Merge Bot
parent 4eeff95f92
commit b84c8821de

View file

@ -494,6 +494,7 @@ void WPEView::handleExportedImage(gpointer image)
GMutexHolder lock(images_mutex); GMutexHolder lock(images_mutex);
GST_TRACE("EGLImage %p wrapped in GstEGLImage %" GST_PTR_FORMAT, eglImage, gstImage); GST_TRACE("EGLImage %p wrapped in GstEGLImage %" GST_PTR_FORMAT, eglImage, gstImage);
gst_clear_mini_object ((GstMiniObject **) &egl.pending);
egl.pending = gstImage; egl.pending = gstImage;
notifyLoadFinished(); notifyLoadFinished();
@ -552,6 +553,7 @@ void WPEView::handleExportedBuffer(struct wpe_fdo_shm_exported_buffer* buffer)
{ {
GMutexHolder lock(images_mutex); GMutexHolder lock(images_mutex);
GST_TRACE("SHM buffer %p wrapped in buffer %" GST_PTR_FORMAT, buffer, gstBuffer); GST_TRACE("SHM buffer %p wrapped in buffer %" GST_PTR_FORMAT, buffer, gstBuffer);
gst_clear_buffer (&shm.pending);
shm.pending = gstBuffer; shm.pending = gstBuffer;
notifyLoadFinished(); notifyLoadFinished();
} }