Test for valid Wayland compositor before trying to shutdown.

Signed-off-by: Chris Michael <devilhorns@comcast.net>
This commit is contained in:
Chris Michael 2013-05-04 14:35:01 +01:00
parent 61ef289fe4
commit ca1b15918d
1 changed files with 20 additions and 17 deletions

View File

@ -294,32 +294,35 @@ e_comp_wl_shutdown(void)
{ {
E_Module *mod = NULL; E_Module *mod = NULL;
/* remove the idler */ if (_e_wl_comp)
if (_e_wl_comp->idler) ecore_idler_del(_e_wl_comp->idler); {
/* remove the idler */
if (_e_wl_comp->idler) ecore_idler_del(_e_wl_comp->idler);
/* remove the fd handler */ /* remove the fd handler */
if (_e_wl_comp->fd_handler) if (_e_wl_comp->fd_handler)
ecore_main_fd_handler_del(_e_wl_comp->fd_handler); ecore_main_fd_handler_del(_e_wl_comp->fd_handler);
/* shutdown input */ /* shutdown input */
_e_comp_wl_input_shutdown(); _e_comp_wl_input_shutdown();
#ifdef HAVE_WAYLAND_EGL #ifdef HAVE_WAYLAND_EGL
/* unbind wayland display */ /* unbind wayland display */
if (_e_wl_comp->egl.bound) if (_e_wl_comp->egl.bound)
_e_wl_comp->egl.unbind_display(_e_wl_comp->egl.display, _e_wl_comp->wl.display); _e_wl_comp->egl.unbind_display(_e_wl_comp->egl.display, _e_wl_comp->wl.display);
/* terminate the egl display */ /* terminate the egl display */
if (_e_wl_comp->egl.display) eglTerminate(_e_wl_comp->egl.display); if (_e_wl_comp->egl.display) eglTerminate(_e_wl_comp->egl.display);
eglReleaseThread(); eglReleaseThread();
#endif #endif
/* if we have a display, destroy it */ /* if we have a display, destroy it */
if (_e_wl_comp->wl.display) wl_display_destroy(_e_wl_comp->wl.display); if (_e_wl_comp->wl.display) wl_display_destroy(_e_wl_comp->wl.display);
/* free the compositor */ /* free the compositor */
E_FREE(_e_wl_comp); E_FREE(_e_wl_comp);
}
/* disable the loaded shell module */ /* disable the loaded shell module */
/* TODO: we should have a config variable somewhere to store which /* TODO: we should have a config variable somewhere to store which