eglglessink: eagl: fix eagl reuse by not releasing the context
authorThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 18 Apr 2013 20:26:15 +0000 (20:26 +0000)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 19 Apr 2013 06:45:02 +0000 (08:45 +0200)
It seems EAGL expects the application to simply ignore unused
EAGL contexts as the resources for it would be released when a new
context is set as the current one. Also move the egl extensions
querying to after a context is set to prevent crashes.

This makes the EAGL version of eglglessink reusable.

ext/eglgles/gstegladaptation_eagl.m

index 68541f4..aae2721 100644 (file)
@@ -306,7 +306,8 @@ void
 gst_egl_adaptation_destroy_context (GstEglAdaptationContext * ctx)
 {
   if (ctx->eaglctx->eagl_context) {
-    [ctx->eaglctx->eagl_context dealloc];
+    /* Do not release/dealloc as it seems that EAGL expects to do all
+     * the cleanup by itself when a new context replaces the old one */
     ctx->eaglctx->eagl_context = NULL;
   }
 }