Enlightenment CVS committal Author : raster Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/lib Modified Files: edje_load.c Log Message: fix segv =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_load.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -3 -r1.61 -r1.62 --- edje_load.c 23 May 2005 17:48:53 -0000 1.61 +++ edje_load.c 24 May 2005 04:25:38 -0000 1.62 @@ -377,7 +377,8 @@ eet_close(ef); ed_file->path = strdup(file); ed_file->collection_hash = NULL; - ed_file->references = -1; + ed_file->references = 1; + _edje_file_hash = evas_hash_add(_edje_file_hash, ed_file->path, ed_file); } if (ed_file->collection_dir) { @@ -441,7 +442,7 @@ eet_close(ef); ed_file->path = strdup(file); ed_file->collection_hash = NULL; - ed_file->references = -1; + ed_file->references = 1; _edje_file_hash = evas_hash_add(_edje_file_hash, ed_file->path, ed_file); } for (l = ed_file->data; l; l = l->next) @@ -557,8 +558,8 @@ { Edje_File *edf; - edf = _edje_file_cache->data; - _edje_file_cache = evas_list_remove_list(_edje_file_cache, _edje_file_cache); + edf = evas_list_last(_edje_file_cache)->data; + _edje_file_cache = evas_list_remove_list(_edje_file_cache, evas_list_last(_edje_file_cache)); _edje_file_free(edf); count = evas_list_count(_edje_file_cache); } @@ -568,7 +569,7 @@ _edje_file_cache_add(Edje_File *edf) { _edje_file_hash = evas_hash_del(_edje_file_hash, edf->path, edf); - _edje_file_cache = evas_list_append(_edje_file_cache, edf); + _edje_file_cache = evas_list_prepend(_edje_file_cache, edf); _edje_file_cache_clean(); } @@ -582,6 +583,11 @@ static void _edje_file_ref(Edje_File *edf) { + if (edf->references == 0) + { + _edje_file_cache = evas_list_remove(_edje_file_cache, edf); + _edje_file_hash = evas_hash_add(_edje_file_hash, edf->path, edf); + } edf->references++; } ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs