Check for valid returns of ecore_wl_registry_get and

ecore_wl_globals_get before trying to use them.
After we have bound a text input manager, there is no need to keep
looping the globals, so break out.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-24 07:23:58 +01:00
parent 7fa2c11e72
commit 449c0c72b0
1 changed files with 9 additions and 2 deletions

View File

@ -95,8 +95,14 @@ im_module_create()
if (!text_input_manager)
{
Ecore_Wl_Global *global;
struct wl_registry *registry = ecore_wl_registry_get();
struct wl_list *globals = ecore_wl_globals_get();
struct wl_registry *registry;
struct wl_list *globals;
if (!(registry = ecore_wl_registry_get()))
return NULL;
if (!(globals = ecore_wl_globals_get()))
return NULL;
wl_list_for_each(global, globals, link)
{
@ -107,6 +113,7 @@ im_module_create()
&wl_text_input_manager_interface, 1);
EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom,
"bound wl_text_input_manager interface");
break;
}
}
}