? data/images/wilber-icon.gif
? devel-docs/app/version.xml
? devel-docs/libgimp/version.xml
? devel-docs/libgimpbase/version.xml
? devel-docs/libgimpcolor/version.xml
? devel-docs/libgimpmath/version.xml
? devel-docs/libgimpmodule/version.xml
? devel-docs/libgimpwidgets/version.xml
Index: app/base/tile-manager.c
===================================================================
RCS file: /cvs/gnome/gimp/app/base/tile-manager.c,v
retrieving revision 1.38
diff -u -r1.38 tile-manager.c
--- app/base/tile-manager.c	16 Nov 2003 17:51:21 -0000	1.38
+++ app/base/tile-manager.c	20 Nov 2003 14:43:09 -0000
@@ -173,11 +173,31 @@
       right_tile  = tm->width  - ((ncols - 1) * TILE_WIDTH);
       bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT);
 
+      /* Do allocation first, then initialisation */
+      for (i = 0, k = 0; i < nrows; i++)
+	{
+	  for (j = 0; j < ncols; j++, k++)
+	    {
+	      tiles[k] = g_try_malloc (sizeof (Tile));
+	      if (tiles[k] == NULL)
+	        {
+		  g_message ("Tile manager allocation failed. Freeing resources.\n");
+		  for (; k >= 0; k--)
+		    {
+		      g_free (tiles[k]);
+		    }
+		  g_free (tiles);
+		  tiles = NULL;
+		  g_message ("Resources liberated.\n");
+		  return NULL;
+		}
+	    }
+	}
+
       for (i = 0, k = 0; i < nrows; i++)
 	{
 	  for (j = 0; j < ncols; j++, k++)
 	    {
-	      tiles[k] = g_new (Tile, 1);
 	      tile_init (tiles[k], tm->bpp);
 	      tile_attach (tiles[k], tm, k);
 
