aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-16 00:09:43 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-16 00:10:13 +0100
commitfed326a3ef853f3c027664b16a4ff51b8d65bfd4 (patch)
tree68c526827af59fe97e5fb055c17dcfb2936e59f7
parenteolian: merge objects in units (diff)
downloadefl-fed326a3ef853f3c027664b16a4ff51b8d65bfd4.tar.gz
eolian: fix unit child management
Also pass correct unit to validation for performance.
-rw-r--r--src/lib/eolian/eo_parser.c10
-rw-r--r--src/lib/eolian/eolian_database.c5
2 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 3b535ddcbc..99ea9499e3 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2197,12 +2197,12 @@ eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot
fname = eina_stringshare_add(filename);
Eolian_Unit *ret = eina_hash_find(parent->state->units, fname);
- eina_stringshare_del(fname);
if (ret)
{
- if ((parent != ret) && !eina_hash_find(parent->children, filename))
- eina_hash_add(parent->children, filename, ret);
+ if ((parent != ret) && !eina_hash_find(parent->children, fname))
+ eina_hash_add(parent->children, fname, ret);
+ eina_stringshare_del(fname);
return ret;
}
@@ -2235,12 +2235,14 @@ eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot
done:
ret = ls->unit;
- eina_hash_add(parent->children, filename, ret);
+ eina_hash_add(parent->children, fname, ret);
+ eina_stringshare_del(fname);
eo_lexer_free(ls);
return ret;
error:
+ eina_stringshare_del(fname);
eo_lexer_free(ls);
return NULL;
}
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 48a2b20a98..f3fc255ad8 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -806,8 +806,7 @@ eolian_state_file_parse(Eolian_State *state, const char *filepath)
if (!_parse_deferred(ret))
return NULL;
_merge_units(ret);
- /* FIXME: pass unit properly */
- if (!database_validate(state, &state->unit))
+ if (!database_validate(state, ret))
return NULL;
return &state->unit;
}
@@ -840,7 +839,6 @@ eolian_state_all_eot_files_parse(Eolian_State *state)
eina_hash_foreach(state->filenames_eot, _tfile_parse, &pd);
- /* FIXME: pass unit properly */
if (pd.ret && !database_validate(state, &state->unit))
return EINA_FALSE;
@@ -869,7 +867,6 @@ eolian_state_all_eo_files_parse(Eolian_State *state)
eina_hash_foreach(state->filenames_eo, _file_parse, &pd);
- /* FIXME: pass unit properly */
if (pd.ret && !database_validate(state, &state->unit))
return EINA_FALSE;