Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_load.c 


Log Message:


memory corruption.. well just not cleaning up things in the cache hash... fix
fix... :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_load.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- edje_load.c 30 Jul 2003 02:58:22 -0000      1.15
+++ edje_load.c 3 Aug 2003 07:00:03 -0000       1.16
@@ -19,12 +19,16 @@
    if (((ed->path) && (!strcmp(file, ed->path))) &&
        (ed->part) && (!strcmp(part, ed->part)))
      return;
+   
    _edje_file_del(ed);
+   
    if (ed->path) free(ed->path);
    ed->path = strdup(file);
    if (ed->part) free(ed->part);
    ed->part = strdup(part);
+   
    _edje_file_add(ed);
+   
    if (ed->collection)
      {
        Evas_List *l;
@@ -197,6 +201,10 @@
             return NULL;
          }
        eet_close(ef);
+       ed_file->path = strdup(file);
+       ed_file->collection_hash = NULL;
+       ed_file->references = 1;
+       _edje_file_hash = evas_hash_add(_edje_file_hash, ed_file->path, ed_file);
      }
    else
      ed_file->references++;
@@ -237,9 +245,7 @@
 
    ed->file = evas_hash_find(_edje_file_hash, ed->path);
    if (ed->file)
-     {
-       ed->file->references++;
-     }
+     ed->file->references++;
    else
      {
        ef = eet_open(ed->path, EET_FILE_MODE_READ);
@@ -256,13 +262,7 @@
             ed->file = NULL;
             goto out;
          }
-       if (!ed->file->collection_dir)
-         {
-            _edje_file_free(ed->file);
-            ed->file = NULL;
-            goto out;       
-         }
-       _edje_file_hash = evas_hash_add(_edje_file_hash, ed->path, ed->file);
+       _edje_file_hash = evas_hash_add(_edje_file_hash, ed->file->path, ed->file);
      }
    
    ed->collection = evas_hash_find(ed->file->collection_hash, ed->part);
@@ -290,7 +290,6 @@
             snprintf(buf, sizeof(buf), "collections/%i", id);
             if (!ef) eet_open(ed->path, EET_FILE_MODE_READ);
             if (!ef) goto out;
-            /* collection leaks? */
             ed->collection = eet_data_read(ef, 
                                            _edje_edd_edje_part_collection, 
                                            buf);
@@ -300,9 +299,7 @@
          }
        else
          {
-            ed->file->references--;
-            if (ed->file->references <= 0)
-              _edje_file_free(ed->file);
+            _edje_file_free(ed->file);
             ed->file = NULL;
          }
      }
@@ -320,14 +317,15 @@
      {
        ed->collection->references--;
        if (ed->collection->references <= 0)
-         _edje_collection_free(ed->collection);
+         {
+            ed->file->collection_hash = evas_hash_del(ed->file->collection_hash, 
ed->part, ed->collection);
+            _edje_collection_free(ed->collection);
+         }
        ed->collection = NULL;
      }
    if (ed->file)
      {
-       ed->file->references--;
-       if (ed->file->references <= 0)
-         _edje_file_free(ed->file);
+       _edje_file_free(ed->file);
        ed->file = NULL;
      }
    if (ed->parts)
@@ -339,7 +337,7 @@
             rp = ed->parts->data;
             ed->parts = evas_list_remove(ed->parts, rp);
             _edje_text_part_on_del(ed, rp);
-//          evas_object_del(rp->object);
+            evas_object_del(rp->object);
             if (rp->swallowed_object)
               {
                  evas_object_event_callback_del(rp->swallowed_object,
@@ -385,6 +383,11 @@
 void
 _edje_file_free(Edje_File *edf)
 {
+   edf->references--;
+   if (edf->references > 0) return;
+   
+   _edje_file_hash = evas_hash_del(_edje_file_hash, edf->path, edf);
+   
    if (edf->path) free(edf->path);
    if (edf->image_dir)
      {




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to