From a76fe079193f8b479051d2fa9cf64c06c5425835 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 19 Aug 2014 20:14:22 +1000 Subject: [PATCH] gl: don't take an extra ref on the display on set_context gst_context_get_gl_display() returns a ref. Don't take another in gst_object_replace(). --- gst-libs/gst/gl/gstglutils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 2d90714b53..2e1b0dd4cf 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -767,8 +767,11 @@ gst_gl_handle_set_context (GstElement * element, GstContext * context, } #endif - if (replacement) - gst_object_replace ((GstObject **) display, (GstObject *) replacement); + if (replacement) { + GstGLDisplay *old = *display; + *display = replacement; + gst_object_unref (old); + } return TRUE; }