Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_desktop


Modified Files:
        ecore_desktop.c ecore_desktop_icon.c ecore_desktop_paths.c 


Log Message:


ok - the leak reports were disturbing me. fixed.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ecore_desktop.c     7 Sep 2006 08:51:47 -0000       1.27
+++ ecore_desktop.c     10 Sep 2006 11:11:54 -0000      1.28
@@ -105,6 +105,8 @@
               }
             else if (current)  /* key=value pair of current group. */
               {
+                 char *tv;
+                 
                  key = c;
                  /* Find trailing blanks or =. */
                  while ((*c != '=') && (*c != ' ') && (*c != '\t')
@@ -129,6 +131,8 @@
                          c++;
                       *c++ = '\0';
                       /* FIXME: should strip space at end, then unescape 
value. */
+                      tv = ecore_hash_remove(current, key);
+                      if (tv) free(tv);
                       ecore_hash_set(current, strdup(key), strdup(value));
 #ifdef DEBUG
                       fprintf(stdout, "    %s=%s\n", key, value);
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop_icon.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ecore_desktop_icon.c        2 Sep 2006 05:06:39 -0000       1.15
+++ ecore_desktop_icon.c        10 Sep 2006 11:11:54 -0000      1.16
@@ -61,6 +61,7 @@
       icon_theme="hicolor";
 
    icons = ecore_desktop_paths_to_list(icon);
+   if (!icons) return NULL;
    ecore_list_goto_first(icons);
    while ((icn = (char *) ecore_list_next(icons)))
       {
@@ -68,16 +69,18 @@
          fprintf(stderr, "\tTrying To Find Icon %s\n", icn);
 #endif
          /* Check for unsupported extension */
-         if (!strcmp(icn + strlen(icn) - 4, ".ico"))
-            continue;
+         if ((strlen(icn) > 4) && 
+            (!strcmp(icn + strlen(icn) - 4, ".ico")))
+          continue;
 
          dir = _ecore_desktop_icon_find0(icn, icon_size, icon_theme);
          if (dir)
-            {
-               dir = strdup(dir);
-              break;
-            }
+          {
+//           dir = strdup(dir);
+             break;
+          }
       }
+   ecore_list_destroy(icons);
 
    return dir;
 }
@@ -137,15 +140,15 @@
    printf("SEARCHING FOR %s\n", icn);
 #endif
    theme_path =
-      ecore_desktop_paths_file_find(ecore_desktop_paths_icons, icn, 2,
-                                         NULL, NULL);
+     ecore_desktop_paths_file_find(ecore_desktop_paths_icons, icn, 2,
+                                  NULL, NULL);
    if (theme_path)
      {
        Ecore_Hash         *theme;
 
        /* Parse the theme description file. */
 #ifdef DEBUG
-       printf("Path to %s is %s\n", icn, theme_path);
+       printf("Path to %s is %s\n", icn, theme_path);B
 #endif
        theme = ecore_desktop_ini_get(theme_path);
        if (theme)
@@ -306,13 +309,21 @@
                                                if (found)
                                                  {
                                                     if (match) /* If there is 
a match in sizes, return the icon. */
-                                                       return found;
+                                                      {
+                                                         
ecore_hash_destroy(theme);
+                                                         
ecore_list_destroy(directory_paths);
+                                                         free(theme_path);
+                                                         return found;
+                                                      }
                                                     if (result_size < 
minimal_size)    /* While we are here, figure out our next fallback strategy. */
                                                       {
                                                          minimal_size =
                                                             result_size;
+                                                         if (closest) 
free(closest);
                                                          closest = found;
                                                       }
+                                                    else
+                                                      free(found);
                                                  }
                                             }
 
@@ -322,7 +333,12 @@
 
                            /* Fall back strategy #1, look for closest size in 
this theme. */
                            if (closest)
-                              return closest;
+                             {
+                                ecore_hash_destroy(theme);
+                                ecore_list_destroy(directory_paths);
+                                free(theme_path);
+                                return closest;
+                             }
 
                            /* Fall back strategy #2, Try again with the parent 
theme. */
                            if ((inherits) && (inherits[0] != '\0')
@@ -332,7 +348,12 @@
                                    _ecore_desktop_icon_find0(icon, icon_size,
                                                              inherits);
                                 if (found != NULL)
-                                   return found;
+                                  {
+                                     ecore_hash_destroy(theme);
+                                     ecore_list_destroy(directory_paths);
+                                     free(theme_path);
+                                     return found;
+                                  }
                              }
 
                            /* Fall back strategy #3, Try the default hicolor 
theme. */
@@ -343,7 +364,12 @@
                                    _ecore_desktop_icon_find0(icon, icon_size,
                                                              "hicolor");
                                 if (found != NULL)
-                                   return found;
+                                  {
+                                     ecore_hash_destroy(theme);
+                                     ecore_list_destroy(directory_paths);
+                                     free(theme_path);
+                                     return found;
+                                  }
                              }
 
                            /* Fall back strategy #4, Just search in the base 
of the icon directories. */
@@ -358,12 +384,18 @@
                                    (ecore_desktop_paths_icons, path, 0, NULL,
                                     NULL);
                                 if (found)
-                                   return found;
+                                  {
+                                     ecore_hash_destroy(theme);
+                                     ecore_list_destroy(directory_paths);
+                                     free(theme_path);
+                                     return found;
+                                  }
                              }
-
+                           ecore_list_destroy(directory_paths);
                         }
                    }
               }
+            ecore_hash_destroy(theme);
          }
        free(theme_path);
      }
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop_paths.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- ecore_desktop_paths.c       10 Sep 2006 10:40:09 -0000      1.23
+++ ecore_desktop_paths.c       10 Sep 2006 11:11:54 -0000      1.24
@@ -354,28 +354,33 @@
    char               *path = NULL, *this_path;
    char                temp[PATH_MAX];
    struct stat         path_stat;
-
+   
    if (paths)
      {
        ecore_list_goto_first(paths);
        while ((this_path = ecore_list_next(paths)) != NULL)
          {
+            if (path)
+              {
+                 free(path);
+                 path = NULL;
+              }
             snprintf(temp, PATH_MAX, "%s%s", this_path, file);
             if (stat(temp, &path_stat) == 0)
               {
-                  if (path)
-                     free(path);
                  path = strdup(temp);
                  if (func)
-                    if (func(data, temp))
-                       break;
+                   {
+                      if (func(data, temp))
+                        break;
+                   }
               }
             else if (sub != 0)
-               path =
-                  ecore_desktop_paths_recursive_search(this_path, file, sub, 
NULL,
-                                                       func, data);
+              path =
+              ecore_desktop_paths_recursive_search(this_path, file, sub, NULL,
+                                                   func, data);
             if (path && (!func))
-               break;
+              break;
          }
      }
 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to