Hi all,

I don't know Lua (yet), but if someone can look at
edje_lua.c/edje_file.c, the deletion of an Edje object does not delete
associated resources such as timers, idlers, animators.

I'll dig into this, but any help is appreciated.

See attached files for working example of the problem. Run and it will
crash as timer will tick but referring object is gone.   Code is
courtesy of Rafael Fonseca, who spotted the problem.

BR,

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
collections {
   group {
      name: "clock";
      min: 200 50;
      max: 200 50;

      parts {
         part {
            name: "bg";
            type: RECT;

            description {
               state: "default" 0.0;
               rel1.relative: 0.0 0.0;
               rel2.relative: 1.0 1.0;
               color: 0 0 0 255;

            }
         }

         part {
            name: "clock";
            type: TEXT;

            description {
               state: "default" 0.0;
               rel1.relative: 0.0 0.0;
               rel2.relative: 1.0 1.0;

               text {
                  text: "";
                  font: "default";
                  size: 30;
                  align: 0.5 0.5;
               }
            }
         }
      }

      programs {
         program {
            signal: "show";
            source: "";
            lua_script {
               function cb (self)
                  local time = os.date("%H:%M:%S")

                  self.ed.clock.text = time

                  return CALLBACK_RENEW
               end

               tim = ed:timer(1, cb)
               tim.ed = ed

               local d = os.date("%H:%M:%S")
               ed.clock.text = d
            }
         }
      }
   }
}

#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Edje.h>

int
main(int argc, char *argv[])
{
   Ecore_Evas *ee;
   Evas_Object *ed;
   Evas_Coord w, h;

   ecore_evas_init();
   edje_init();

   ee = ecore_evas_new(NULL, 0, 0, 320, 240, NULL);

   ed = edje_object_add(ecore_evas_get(ee));
   if (!edje_object_file_set(ed, "clock.edj", "clock")) {
      fprintf(stderr, "Could not load edje file clock.edj, group clock: %s\n",
	      edje_load_error_str(edje_object_load_error_get(ed)));
      return -1;
   }

   ecore_evas_object_associate(ee, ed, ECORE_EVAS_OBJECT_ASSOCIATE_DEL);

   edje_object_size_min_get(ed, &w, &h);
   evas_object_resize(ed, w, h);
   evas_object_show(ed);

   ecore_main_loop_begin();

   edje_shutdown();
   ecore_evas_shutdown();

   return 0;
}

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to