forked from enlightenment/efl
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
This commit is contained in:
parent
f836dd0c22
commit
568e1db550
|
@ -43,6 +43,8 @@ Eina_Bool _use_build_config;
|
||||||
static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
|
static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
|
||||||
EAPI Elm_Version *elm_version = &_version;
|
EAPI Elm_Version *elm_version = &_version;
|
||||||
|
|
||||||
|
Eina_FreeQ *postponed_fq = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_focus_ev_redirect_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
_focus_ev_redirect_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -755,6 +757,12 @@ elm_quicklaunch_mode_get(void)
|
||||||
return quicklaunch_on;
|
return quicklaunch_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_postpone_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
||||||
|
{
|
||||||
|
eina_freeq_clear(postponed_fq);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
elm_quicklaunch_init(int argc EINA_UNUSED,
|
elm_quicklaunch_init(int argc EINA_UNUSED,
|
||||||
char **argv)
|
char **argv)
|
||||||
|
@ -766,6 +774,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
|
||||||
_elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
|
_elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
|
||||||
EINA_SAFETY_ON_TRUE_GOTO(_elm_log_dom < 0, fail_eina_log);
|
EINA_SAFETY_ON_TRUE_GOTO(_elm_log_dom < 0, fail_eina_log);
|
||||||
|
|
||||||
|
postponed_fq = eina_freeq_new(EINA_FREEQ_POSTPONED);
|
||||||
|
|
||||||
EINA_SAFETY_ON_FALSE_GOTO(eet_init(), fail_eet);
|
EINA_SAFETY_ON_FALSE_GOTO(eet_init(), fail_eet);
|
||||||
EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), fail_ecore);
|
EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), fail_ecore);
|
||||||
EINA_SAFETY_ON_FALSE_GOTO(ecore_event_init(), fail_ecore_event);
|
EINA_SAFETY_ON_FALSE_GOTO(ecore_event_init(), fail_ecore_event);
|
||||||
|
@ -812,6 +822,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
|
||||||
if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
|
if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
|
||||||
if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style");
|
if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style");
|
||||||
|
|
||||||
|
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE_EXIT, _postpone_cb, NULL);
|
||||||
|
|
||||||
eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
|
eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
|
||||||
|
|
||||||
if (quicklaunch_on)
|
if (quicklaunch_on)
|
||||||
|
@ -946,6 +958,11 @@ elm_quicklaunch_shutdown(void)
|
||||||
emap_shutdown();
|
emap_shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
efl_event_callback_del(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE_EXIT, _postpone_cb, NULL);
|
||||||
|
|
||||||
|
eina_freeq_free(postponed_fq);
|
||||||
|
postponed_fq = NULL;
|
||||||
|
|
||||||
ecore_file_shutdown();
|
ecore_file_shutdown();
|
||||||
eio_shutdown();
|
eio_shutdown();
|
||||||
ecore_event_shutdown();
|
ecore_event_shutdown();
|
||||||
|
|
|
@ -905,6 +905,8 @@ extern Eina_Stringshare *_property_style_ss;
|
||||||
|
|
||||||
extern Eina_Bool _config_profile_lock;
|
extern Eina_Bool _config_profile_lock;
|
||||||
|
|
||||||
|
extern Eina_FreeQ *postponed_fq;
|
||||||
|
|
||||||
# ifdef HAVE_ELEMENTARY_WL2
|
# ifdef HAVE_ELEMENTARY_WL2
|
||||||
extern Ecore_Wl2_Display *_elm_wl_display;
|
extern Ecore_Wl2_Display *_elm_wl_display;
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Reference in New Issue