From d5a68314e746672658527aa4c8692079650d4c23 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Wed, 20 Dec 2017 11:02:59 +0900 Subject: [PATCH] loop: Fix loop_get search priority 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. --- src/lib/ecore/efl_loop_consumer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore/efl_loop_consumer.c b/src/lib/ecore/efl_loop_consumer.c index 389e0c5..f984909 100644 --- a/src/lib/ecore/efl_loop_consumer.c +++ b/src/lib/ecore/efl_loop_consumer.c @@ -14,9 +14,14 @@ 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); + 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 -- 2.7.4