wayland_egl: ensure gl context destruction when unsetting wl_display
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 5 May 2016 14:38:31 +0000 (10:38 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 5 May 2016 14:49:30 +0000 (10:49 -0400)
extra refcounting during setup in this case will prevent the context
destruction, leading to a dead gl context which is unable to render

src/modules/evas/engines/wayland_egl/evas_engine.c

index 4945a70..1252e91 100644 (file)
@@ -726,8 +726,14 @@ eng_setup(Evas *evas, void *info)
                  (ob->info->info.screen != ob->screen) ||
                  (ob->info->info.destination_alpha != ob->alpha))
                {
-                  ob->gl_context->references++;
                   gl_wins--;
+                  if (!ob->info->info.display)
+                    {
+                       eng_window_free(re->generic.software.ob);
+                       re->generic.software.ob = NULL;
+                       epd->engine.data.output = NULL;
+                       goto ob_err;
+                    }
 
                   ob = eng_window_new(evas, inf, epd->output.w, epd->output.h, swap_mode);
                   if (!ob) goto ob_err;
@@ -737,7 +743,6 @@ eng_setup(Evas *evas, void *info)
                   evas_render_engine_software_generic_update(&re->generic.software, ob,
                                                              epd->output.w, epd->output.h);
                   gl_wins++;
-                  eng_get_ob(re)->gl_context->references--;
                }
              else if ((ob->w != epd->output.w) || (ob->h != epd->output.h) ||
                       (ob->info->info.rotation != ob->rot))