gldisplay: always unref the context on a collision
authorMatthew Waters <matthew@centricular.com>
Thu, 26 May 2016 10:16:07 +0000 (20:16 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:20 +0000 (19:32 +0000)
Otherwise we will leak GstGLContext's when adding the same context more than
once.

Fixes a regression caused by 5f9d10f6036068502ad23e1ec86a73e341801ae1 in the
gstglcontext unit test that failed with:

Assertion 'tmp == NULL' failed

gst-libs/gst/gl/gstgldisplay.c

index ee8febc4b9b3b57c0d8af34077c021cb26591ef2..fee031679eca6a774653fa2e605805be388274e8 100644 (file)
@@ -558,7 +558,6 @@ gst_gl_display_add_context (GstGLDisplay * display, GstGLContext * context)
     if (context == collision) {
       GST_LOG_OBJECT (display, "Attempting to add the same GL context %"
           GST_PTR_FORMAT ". Ignoring", context);
-      collision = NULL;
       ret = TRUE;
       goto out;
     }