leake! fix!
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 4 Jun 2010 06:45:46 +0000 (06:45 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 4 Jun 2010 06:45:46 +0000 (06:45 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@49445 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_cache.c
src/lib/edje_embryo.c
src/lib/edje_load.c
src/lib/edje_private.h

index 4665321..f77a4c5 100644 (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);
      }
 
index 4ad0e4a..873516a 100644 (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
index 865fd25..895a8fa 100644 (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;
index 21aa8ad..11e8882 100644 (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);