Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_misc.c Log Message: Use an idler for garbage collection when there are widgets to free. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_misc.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- ewl_misc.c 13 Nov 2005 06:48:55 -0000 1.26 +++ ewl_misc.c 18 Nov 2005 05:13:58 -0000 1.27 @@ -17,6 +17,7 @@ static unsigned int debug_level = 0; static Ecore_Idle_Enterer *idle_enterer = NULL; +static Ecore_Idler *ewl_garbage_collect = NULL; static int _ewl_init_count = 0; /* @@ -221,7 +222,7 @@ while ((emb = ecore_list_remove_first(ewl_embed_list))) ewl_widget_destroy(emb); - while (ewl_garbage_collect() > 0); + while (ewl_garbage_collect_idler(NULL) > 0); ecore_list_destroy(ewl_embed_list); ewl_embed_list = NULL; } @@ -356,7 +357,8 @@ if (!ecore_list_is_empty(destroy_list) || !ecore_list_is_empty(free_evas_list) || !ecore_list_is_empty(free_evas_object_list)) - ewl_garbage_collect(); + ewl_garbage_collect = ecore_idler_add(ewl_garbage_collect_idler, + NULL);; if (!ecore_list_is_empty(realize_list)) ewl_realize_queue(); @@ -882,7 +884,7 @@ * @brief Free's all widgets that have been marked for destruction. */ int -ewl_garbage_collect(void) +ewl_garbage_collect_idler(void *data __UNUSED__) { Evas *evas; Ewl_Widget *w; @@ -901,6 +903,7 @@ if (ewl_object_queued_has(EWL_OBJECT(w), EWL_FLAG_QUEUED_CSCHEDULED)) ewl_configure_cancel_request(w); + /* printf("Cleanup count %d: %s\n", cleanup, w->inheritance); */ ewl_callback_call(w, EWL_CALLBACK_DESTROY); ewl_callback_del_type(w, EWL_CALLBACK_DESTROY); FREE(w); @@ -930,6 +933,9 @@ if (print_gc_reap) printf("---\n"); + if (!ecore_list_nodes(destroy_list)) + ewl_garbage_collect = NULL; + DRETURN_INT(ecore_list_nodes(destroy_list), DLEVEL_STABLE); } ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs