According to comments by @k-s & @raster.
See
784a5b56a3c798e5a8 this was intended to be a fallback, not the first
lookup indeed. Since this is an error case, let's print an ERR message
at least.
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);
+ Efl_Loop *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
+ if (!loop && eina_main_loop_is())
+ {
+ loop = ecore_main_loop_get();
+ ERR("Failed to get the loop on object %p from the main thread! "
+ "Returning the main loop: %p", obj, loop);
+ }
+ return loop;
}
static void