From bc7174262f7b58235129276b4744a48a8a3c7f4c Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 21 Apr 2016 11:53:31 -0700 Subject: [PATCH] ecore: make the main loop singleton initialized and available early on. --- src/lib/ecore/ecore.c | 3 +++ src/lib/ecore/ecore_main.c | 4 +++- src/lib/ecore/ecore_private.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 2f1d780918..1f31476baa 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -361,6 +361,9 @@ ecore_shutdown(void) } #endif + eo_del(_mainloop_singleton); + _mainloop_singleton = NULL; + if (_ecore_fps_debug) _ecore_fps_debug_shutdown(); _ecore_poller_shutdown(); _ecore_animator_shutdown(); diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index dd7c64f223..aac6a54a96 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -1159,6 +1159,8 @@ _ecore_main_loop_init(void) #endif detect_time_changes_start(); + + _mainloop_singleton = eo_add(ECORE_MAINLOOP_CLASS, NULL); } void @@ -2709,7 +2711,7 @@ _ecore_main_win32_select(int nfds EINA_UNUSED, #endif -static Eo *_mainloop_singleton = NULL; +Eo *_mainloop_singleton = NULL; EAPI Eo *ecore_main_loop_get(void) { diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index 7e90832e95..547a9473a0 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -363,6 +363,7 @@ GENERIC_ALLOC_FREE_HEADER(Ecore_Win32_Handler, ecore_win32_handler); #undef GENERIC_ALLOC_FREE_HEADER +extern Eo *_mainloop_singleton; extern Eo *_ecore_parent; #define ECORE_PARENT_CLASS ecore_parent_class_get() EAPI const Eo_Class *ecore_parent_class_get(void) EINA_CONST;