loop: Try harder to find the main loop

If the object has no parent or anything else goes a bit wrong,
efl_loop_get() may fail to return the loop object. It's a bit ridiculous
when we're in the main loop as we know which loop object was requested.

This avoids returning NULL.
This commit is contained in:
Jean-Philippe Andre 2017-12-18 11:58:43 +09:00
parent fed8123448
commit 784a5b56a3
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,8 @@ struct _Efl_Loop_Consumer_Data
static Efl_Loop *
_efl_loop_consumer_loop_get(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED)
{
if (eina_main_loop_is())
return ecore_main_loop_get();
return efl_provider_find(obj, EFL_LOOP_CLASS);
}