edf->dangling = EINA_FALSE;
edf->warning = EINA_FALSE;
+ /* Below you will find all memory structure that could be cleaned when under
+ memory pressure */
edf->collection_cache = NULL;
+ edf->collection_patterns = NULL;
return edf;
}
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
if (edf != NULL)
{
- /* FIXME: cache the result in Edje_File structure */
- Edje_Part_Collection_Directory_Entry *ce;
- Eina_Iterator *i;
- Eina_List *l = NULL;
Edje_Patterns *patterns;
- i = eina_hash_iterator_data_new(edf->collection);
+ if (edf->collection_patterns)
+ {
+ patterns = edf->collection_patterns;
+ }
+ else
+ {
+ Edje_Part_Collection_Directory_Entry *ce;
+ Eina_Iterator *i;
+ Eina_List *l = NULL;
+
+ i = eina_hash_iterator_data_new(edf->collection);
- EINA_ITERATOR_FOREACH(i, ce)
- l = eina_list_append(l, ce);
+ EINA_ITERATOR_FOREACH(i, ce)
+ l = eina_list_append(l, ce);
- eina_iterator_free(i);
+ eina_iterator_free(i);
- patterns = edje_match_collection_dir_init(l);
+ patterns = edje_match_collection_dir_init(l);
+ eina_list_free(l);
+ }
succeed = edje_match_collection_dir_exec(patterns, glob);
- edje_match_patterns_free(patterns);
- eina_list_free(l);
+ edf->collection_patterns = patterns;
_edje_cache_file_unref(edf);
}
free(ecc);
}
+ if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns);
if (edf->path) eina_stringshare_del(edf->path);
if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
if (edf->collection_cache) _edje_cache_coll_flush(edf);