From 6461bf19b68125fdc0399cfbaddb23cccbc0e3c9 Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 10 Mar 2011 06:35:33 +0000 Subject: [PATCH] fix shutdown+init cycle with deferred win free git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@57654 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_main.c | 2 ++ src/lib/elm_priv.h | 1 + src/lib/elm_win.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index c8ca6b9..c1ab941 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -360,6 +360,8 @@ elm_shutdown(void) { _elm_init_count--; if (_elm_init_count > 0) return _elm_init_count; + _elm_win_shutdown(); + while (_elm_win_deferred_free) ecore_main_loop_iterate(); elm_quicklaunch_sub_shutdown(); elm_quicklaunch_shutdown(); return _elm_init_count; diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index b808f86..6932fda 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -207,5 +207,6 @@ extern const char *_elm_data_dir; extern const char *_elm_lib_dir; extern int _elm_log_dom; extern Eina_List *_elm_win_list; +extern int _elm_win_deferred_free; #endif diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index ac287d1..fa16fd8 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -73,6 +73,7 @@ static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, cons static void _elm_win_focus_highlight_reconfigure(Elm_Win *win); Eina_List *_elm_win_list = NULL; +int _elm_win_deferred_free = 0; static void _elm_win_move(Ecore_Evas *ee) @@ -198,6 +199,7 @@ static void _deferred_ecore_evas_free(void *data) { ecore_evas_free(data); + _elm_win_deferred_free--; } static void @@ -246,7 +248,9 @@ _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void // evas_font_cache_flush(win->evas); // FIXME: we are in the del handler for the object and delete the canvas // that lives under it from the handler... nasty. deferring doesn't help either + ecore_job_add(_deferred_ecore_evas_free, win->ee); + _elm_win_deferred_free++; // ecore_evas_free(win->ee); _elm_win_focus_highlight_shutdown(win); -- 2.7.4