ecore-evas-wayland: Properly cleanup ecore_wl2 during error
authorChris Michael <cpmichael@osg.samsung.com>
Fri, 4 Dec 2015 16:40:54 +0000 (11:40 -0500)
committerChris Michael <cpmichael@osg.samsung.com>
Fri, 4 Dec 2015 16:40:54 +0000 (11:40 -0500)
If we fail to connect to an existing wayland display, then we should
properly cleanup (call ecore_wl2_shutdown) before exiting

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c

index 8f4fea9..b6b0189 100644 (file)
@@ -146,7 +146,7 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
    if (!ewd)
      {
         ERR("Failed to connect to Wayland Display %s", disp_name);
-        return NULL;
+        goto conn_err;
      }
 
    if (!(ee = calloc(1, sizeof(Ecore_Evas))))
@@ -284,12 +284,12 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
 
    return ee;
 
- err:
+err:
    ecore_evas_free(ee);
-   return NULL;
-
- ee_err:
-   ecore_wl_shutdown();
+ee_err:
+   ecore_wl2_display_disconnect(ewd);
+conn_err:
+   ecore_wl2_shutdown();
    return NULL;
 }
 
index c516de6..fb1e25b 100644 (file)
@@ -145,7 +145,7 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent,
    if (!ewd)
      {
         ERR("Failed to connect to Wayland Display %s", disp_name);
-        return NULL;
+        goto conn_err;
      }
 
    if (!(ee = calloc(1, sizeof(Ecore_Evas))))
@@ -280,12 +280,11 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent,
 
    return ee;
 
- err:
+err:
    ecore_evas_free(ee);
-   return NULL;
-
- ee_err:
+ee_err:
    ecore_wl2_display_disconnect(ewd);
+conn_err:
    ecore_wl2_shutdown();
    return NULL;
 }