The evas object isn't always created.
authorsebastid <sebastid>
Sat, 7 Jan 2006 13:21:35 +0000 (13:21 +0000)
committersebastid <sebastid@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 7 Jan 2006 13:21:35 +0000 (13:21 +0000)
SVN revision: 19606

src/bin/e_thumb.c

index cc839c7..ca3ae4b 100644 (file)
@@ -359,7 +359,7 @@ e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
 {
    Eet_File *ef;
    char *thumbpath, *ext;
-   Evas_Object *im;
+   Evas_Object *im = NULL;
    const int *data;
    int size, ww, hh;
    Ecore_Evas *buf;
@@ -375,7 +375,7 @@ e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
    
    if (ext)
      {
-       if(!strcasecmp(ext, ".edj"))
+       if (!strcasecmp(ext, ".edj"))
          {
             /* for now, this function does both the bg and theme previews */
             data = _e_thumb_etheme_create(file, w, h, &ww, &hh, &alpha, &im, &buf);
@@ -392,7 +392,7 @@ e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
        if (!ef)
          {
             free(thumbpath);
-            evas_object_del(im);
+            if (im) evas_object_del(im);
             ecore_evas_free(buf);
             return -1;
          }
@@ -403,14 +403,14 @@ e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
                                         (void *)data, ww, hh, alpha,
                                         0, 91, 1)) <= 0)
          {
-            evas_object_del(im);
+            if (im) evas_object_del(im);
             ecore_evas_free(buf);
             eet_close(ef);
             return -1;
          }
        eet_close(ef);
      }
-   evas_object_del(im);
+   if (im) evas_object_del(im);
    ecore_evas_free(buf);
    return 1;
 }