fix shutdown+init cycle with deferred win free

SVN revision: 57654
This commit is contained in:
Carsten Haitzler 2011-03-10 06:35:33 +00:00
parent 69fad7b41a
commit 36e246b816
3 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -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

View File

@ -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);