ecore-evas-wayland: Properly cleanup ecore_wl2 during error

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>
This commit is contained in:
Chris Michael 2015-12-04 11:40:54 -05:00
parent 04a4b599ab
commit 49e645d695
2 changed files with 10 additions and 11 deletions

View File

@ -146,7 +146,7 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
if (!ewd) if (!ewd)
{ {
ERR("Failed to connect to Wayland Display %s", disp_name); ERR("Failed to connect to Wayland Display %s", disp_name);
return NULL; goto conn_err;
} }
if (!(ee = calloc(1, sizeof(Ecore_Evas)))) 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; return ee;
err: err:
ecore_evas_free(ee); ecore_evas_free(ee);
return NULL; ee_err:
ecore_wl2_display_disconnect(ewd);
ee_err: conn_err:
ecore_wl_shutdown(); ecore_wl2_shutdown();
return NULL; return NULL;
} }

View File

@ -145,7 +145,7 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent,
if (!ewd) if (!ewd)
{ {
ERR("Failed to connect to Wayland Display %s", disp_name); ERR("Failed to connect to Wayland Display %s", disp_name);
return NULL; goto conn_err;
} }
if (!(ee = calloc(1, sizeof(Ecore_Evas)))) 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; return ee;
err: err:
ecore_evas_free(ee); ecore_evas_free(ee);
return NULL; ee_err:
ee_err:
ecore_wl2_display_disconnect(ewd); ecore_wl2_display_disconnect(ewd);
conn_err:
ecore_wl2_shutdown(); ecore_wl2_shutdown();
return NULL; return NULL;
} }