leake! fix!

SVN revision: 49445
This commit is contained in:
Carsten Haitzler 2010-06-04 06:45:46 +00:00
parent eb886add0e
commit 2049cf563c
4 changed files with 20 additions and 20 deletions

View File

@ -88,6 +88,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
if (data)
{
edc->script = embryo_program_new(data, size);
_edje_embryo_script_init(edc);
free(data);
}

View File

@ -2660,15 +2660,14 @@ _edje_embryo_fn_external_param_set_bool(Embryo_Program *ep, Embryo_Cell *params)
}
void
_edje_embryo_script_init(Edje *ed)
_edje_embryo_script_init(Edje_Part_Collection *edc)
{
Embryo_Program *ep;
if (!ed) return;
if (!ed->collection) return;
if (!ed->collection->script) return;
ep = ed->collection->script;
embryo_program_data_set(ep, ed);
if (!edc) return;
if (!edc->script) return;
ep = edc->script;
/* first advertise all the edje "script" calls */
embryo_program_native_call_add(ep, "get_int", _edje_embryo_fn_get_int);
embryo_program_native_call_add(ep, "set_int", _edje_embryo_fn_set_int);
@ -2750,21 +2749,16 @@ _edje_embryo_script_init(Edje *ed)
embryo_program_native_call_add(ep, "external_param_set_choice", _edje_embryo_fn_external_param_set_choice);
embryo_program_native_call_add(ep, "external_param_get_bool", _edje_embryo_fn_external_param_get_bool);
embryo_program_native_call_add(ep, "external_param_set_bool", _edje_embryo_fn_external_param_set_bool);
// embryo_program_vm_push(ed->collection->script);
// _edje_embryo_globals_init(ed);
}
void
_edje_embryo_script_shutdown(Edje *ed)
_edje_embryo_script_shutdown(Edje_Part_Collection *edc)
{
if (!ed) return;
if (!ed->collection) return;
if (!ed->collection->script) return;
if (embryo_program_recursion_get(ed->collection->script) > 0) return;
// embryo_program_vm_pop(ed->collection->script);
embryo_program_free(ed->collection->script);
ed->collection->script = NULL;
if (!edc) return;
if (!edc->script) return;
if (embryo_program_recursion_get(edc->script) > 0) return;
embryo_program_free(edc->script);
edc->script = NULL;
}
void

View File

@ -558,7 +558,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
_edje_ref(ed);
_edje_block(ed);
_edje_freeze(ed);
if (ed->collection->script) _edje_embryo_script_init(ed);
// if (ed->collection->script) _edje_embryo_script_init(ed);
_edje_var_init(ed);
for (i = 0; i < ed->table_parts_size; i++)
{
@ -843,6 +843,10 @@ _edje_file_del(Edje *ed)
_edje_block_violate(ed);
_edje_var_shutdown(ed);
_edje_programs_patterns_clean(ed);
// if (ed->collection)
// {
// if (ed->collection->script) _edje_embryo_script_shutdown(ed);
// }
if (!((ed->file) && (ed->collection))) return;
if (ed->table_parts)
@ -1112,6 +1116,7 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec)
Edje_Program *pr;
Edje_Part *ep;
_edje_embryo_script_shutdown(ec);
EINA_LIST_FREE(ec->programs, pr)
{
Edje_Program_Target *prt;

View File

@ -1400,8 +1400,8 @@ Eina_Bool _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Par
char *_edje_text_escape(const char *text);
char *_edje_text_unescape(const char *text);
void _edje_embryo_script_init (Edje *ed);
void _edje_embryo_script_shutdown (Edje *ed);
void _edje_embryo_script_init (Edje_Part_Collection *edc);
void _edje_embryo_script_shutdown (Edje_Part_Collection *edc);
void _edje_embryo_script_reset (Edje *ed);
void _edje_embryo_test_run (Edje *ed, const char *fname, const char *sig, const char *src);
Edje_Var *_edje_var_new (void);