and the xpm loader also leaked!
authorCarsten Haitzler <raster@rasterman.com>
Sun, 24 Sep 2006 23:31:21 +0000 (23:31 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Sun, 24 Sep 2006 23:31:21 +0000 (23:31 +0000)
SVN revision: 26126

legacy/evas/src/modules/loaders/xpm/evas_image_load_xpm.c

index a5e1926..b56f7ff 100644 (file)
@@ -371,12 +371,15 @@ evas_image_load_file_xpm(RGBA_Image *im, const char *file, const char *key, int
                       
                        if (load_data)
                          {
+                           if (im->image->data)
+                             evas_common_image_surface_dealloc(im->image);
                            im->image->w = w;
                            im->image->h = h;
                             evas_common_image_surface_alloc(im->image);
                             if (!im->image->data)
                               {
                                  evas_common_image_surface_free(im->image);
+                                im->image = NULL;
                                  free(cmap);
                                  free(line);
                                  fclose(f);