summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-04-02 12:30:45 -0700
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-21 11:36:48 +0200
commit856a453dd8a7979d58e306fbbd3a407e7267ede6 (patch)
tree49951094565d022aaa0bd5ed7279790dde0c3f40
parent44fb906c4ffcc5aa6a198d54ab2f9e05133d2a32 (diff)
elementary: add a queue to postpone object destruction when necessary.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8540
-rw-r--r--src/lib/elementary/elm_main.c17
-rw-r--r--src/lib/elementary/elm_priv.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 676f1a9e8a..f3438364e3 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -43,6 +43,8 @@ Eina_Bool _use_build_config;
43static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV }; 43static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
44EAPI Elm_Version *elm_version = &_version; 44EAPI Elm_Version *elm_version = &_version;
45 45
46Eina_FreeQ *postponed_fq = NULL;
47
46static void 48static void
47_focus_ev_redirect_cb(void *data, const Efl_Event *ev EINA_UNUSED) 49_focus_ev_redirect_cb(void *data, const Efl_Event *ev EINA_UNUSED)
48{ 50{
@@ -755,6 +757,12 @@ elm_quicklaunch_mode_get(void)
755 return quicklaunch_on; 757 return quicklaunch_on;
756} 758}
757 759
760static void
761_postpone_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
762{
763 eina_freeq_clear(postponed_fq);
764}
765
758EAPI int 766EAPI int
759elm_quicklaunch_init(int argc EINA_UNUSED, 767elm_quicklaunch_init(int argc EINA_UNUSED,
760 char **argv) 768 char **argv)
@@ -766,6 +774,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
766 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE); 774 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
767 EINA_SAFETY_ON_TRUE_GOTO(_elm_log_dom < 0, fail_eina_log); 775 EINA_SAFETY_ON_TRUE_GOTO(_elm_log_dom < 0, fail_eina_log);
768 776
777 postponed_fq = eina_freeq_new(EINA_FREEQ_POSTPONED);
778
769 EINA_SAFETY_ON_FALSE_GOTO(eet_init(), fail_eet); 779 EINA_SAFETY_ON_FALSE_GOTO(eet_init(), fail_eet);
770 EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), fail_ecore); 780 EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), fail_ecore);
771 EINA_SAFETY_ON_FALSE_GOTO(ecore_event_init(), fail_ecore_event); 781 EINA_SAFETY_ON_FALSE_GOTO(ecore_event_init(), fail_ecore_event);
@@ -812,6 +822,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
812 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/"); 822 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
813 if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style"); 823 if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style");
814 824
825 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE_EXIT, _postpone_cb, NULL);
826
815 eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); 827 eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
816 828
817 if (quicklaunch_on) 829 if (quicklaunch_on)
@@ -946,6 +958,11 @@ elm_quicklaunch_shutdown(void)
946 emap_shutdown(); 958 emap_shutdown();
947#endif 959#endif
948 960
961 efl_event_callback_del(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE_EXIT, _postpone_cb, NULL);
962
963 eina_freeq_free(postponed_fq);
964 postponed_fq = NULL;
965
949 ecore_file_shutdown(); 966 ecore_file_shutdown();
950 eio_shutdown(); 967 eio_shutdown();
951 ecore_event_shutdown(); 968 ecore_event_shutdown();
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 478497468d..94316191a5 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -907,6 +907,8 @@ extern Eina_Stringshare *_property_style_ss;
907 907
908extern Eina_Bool _config_profile_lock; 908extern Eina_Bool _config_profile_lock;
909 909
910extern Eina_FreeQ *postponed_fq;
911
910# ifdef HAVE_ELEMENTARY_WL2 912# ifdef HAVE_ELEMENTARY_WL2
911extern Ecore_Wl2_Display *_elm_wl_display; 913extern Ecore_Wl2_Display *_elm_wl_display;
912# endif 914# endif