Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/canvas


Modified Files:
        evas_main.c evas_object_text.c 


Log Message:


till's shutdown patch - this is good (tm). :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_main.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas_main.c 18 Oct 2003 03:34:00 -0000      1.8
+++ evas_main.c 13 Jan 2004 02:24:03 -0000      1.9
@@ -24,6 +24,12 @@
 
 #include "Evas.h"
 
+void
+evas_shutdown(void)
+{
+   evas_font_dir_cache_free();
+}
+
 /**
  * Allocate and new Evas empty canvas.
  * @return A zeroed out Evas, or NULL on failure
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_text.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- evas_object_text.c  29 Oct 2003 00:22:46 -0000      1.19
+++ evas_object_text.c  13 Jan 2004 02:24:03 -0000      1.20
@@ -75,6 +75,24 @@
 static void object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd);
 static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]);
 
+static Evas_Bool font_cache_dir_free(Evas_Hash *hash, const char *key,
+                                     void *data, void *fdata)
+{
+   object_text_font_cache_dir_del((char *) key, data);
+
+   return 1;
+}
+
+void
+evas_font_dir_cache_free(void)
+{
+   if (!font_dirs) return;
+
+   evas_hash_foreach (font_dirs, font_cache_dir_free, NULL);
+   evas_hash_free (font_dirs);
+   font_dirs = NULL;
+}
+
 static char *
 object_text_font_cache_find(char *dir, char *font)
 {
@@ -102,8 +120,11 @@
      {
        mt = evas_file_modified_time(dir);
        if (mt != fd->dir_mod_time)
+    {
          object_text_font_cache_dir_del(dir, fd);
-       else
+      font_dirs = evas_hash_del(font_dirs, dir, fd);
+       }
+    else
          {
             tmp = evas_file_path_join(dir, "fonts.dir");
             if (tmp)
@@ -111,8 +132,11 @@
                  mt = evas_file_modified_time(tmp);
                  free(tmp);
                  if (mt != fd->fonts_dir_mod_time)
+          {
                    object_text_font_cache_dir_del(dir, fd);
-                 else
+            font_dirs = evas_hash_del(font_dirs, dir, fd);
+                 }
+          else
                    {
                       tmp = evas_file_path_join(dir, "fonts.alias");
                       if (tmp)
@@ -121,8 +145,11 @@
                            free(tmp);
                         }
                       if (mt != fd->fonts_alias_mod_time)
-                        object_text_font_cache_dir_del(dir, fd);
-                      else
+               {
+                            object_text_font_cache_dir_del(dir, fd);
+                 font_dirs = evas_hash_del(font_dirs, dir, fd);
+                          }
+               else
                         return fd;
                    }
               }
@@ -362,7 +389,6 @@
 static void
 object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd)
 {
-   font_dirs = evas_hash_del(font_dirs, dir, fd);
    if (fd->lookup) evas_hash_free(fd->lookup);
    while (fd->fonts)
      {




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to