cedric pushed a commit to branch master.

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

commit 15ddd174a1f30b26f5cc67ce983bcc6ce0567031
Author: Jean Guyomarc'h <jean.guyoma...@gmail.com>
Date:   Fri Mar 4 16:00:58 2016 -0800

    ecore: better resources use in the glib integration
    
    Summary:
    When glib support is enabled (HAVE_GLIB), _ecore_glib_init()
    was always reserving resources. However, its counterpart may not
    be called when:
    - glib is not always integrated and
    - when a user didn't explicitly required the integration.
    
    Calling _ecore_glib_init() within the request code will cause the
    resources to be reserved only when the integration with glib is
    required and furthermore guarantees that resources always have a
    chance to be released.
    
    Reviewers: cedric, raster
    
    Subscribers: cedric, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3749
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/ecore/ecore.c      | 1 -
 src/lib/ecore/ecore_glib.c | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 0a5b1d8..247612b 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -248,7 +248,6 @@ ecore_init(void)
    _ecore_exe_init();
 #endif
    _ecore_thread_init();
-   _ecore_glib_init();
    _ecore_job_init();
    _ecore_time_init();
 
diff --git a/src/lib/ecore/ecore_glib.c b/src/lib/ecore/ecore_glib.c
index e2586c1..7232d15 100644
--- a/src/lib/ecore/ecore_glib.c
+++ b/src/lib/ecore/ecore_glib.c
@@ -275,6 +275,9 @@ ecore_main_loop_glib_integrate(void)
    _ecore_glib_select_original = func;
    ecore_main_loop_select_func_set(_ecore_glib_select);
    _ecore_glib_active = EINA_TRUE;
+
+   /* Init only when requested */
+   _ecore_glib_init();
    return EINA_TRUE;
 #else
    ERR("No glib support");

-- 


Reply via email to