cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bc7174262f7b58235129276b4744a48a8a3c7f4c

commit bc7174262f7b58235129276b4744a48a8a3c7f4c
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Thu Apr 21 11:53:31 2016 -0700

    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 2f1d780..1f31476 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 dd7c64f..aac6a54 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 7e90832..547a947 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;

-- 


Reply via email to