[postgis-commits] svn - r3616 - spike/wktraster/rt_core

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Mon Feb 2 10:06:53 PST 2009


Author: strk
Date: 2009-02-02 10:06:53 -0800 (Mon, 02 Feb 2009)
New Revision: 3616

Modified:
   spike/wktraster/rt_core/rt_api.c
   spike/wktraster/rt_core/testwkb.c
Log:
release more memory

Modified: spike/wktraster/rt_core/rt_api.c
===================================================================
--- spike/wktraster/rt_core/rt_api.c	2009-02-02 17:58:38 UTC (rev 3615)
+++ spike/wktraster/rt_core/rt_api.c	2009-02-02 18:06:53 UTC (rev 3616)
@@ -1798,6 +1798,7 @@
             ctx->warn("We parsed %d bytes more then available!",
                 ptr-wkbend);
         }
+	rast->bands = 0;
         return rast;
     }
 
@@ -1875,7 +1876,7 @@
 
     rt_raster r = rt_raster_from_wkb(ctx, wkb, wkbsize);
 
-    //ctx->dealloc(wkb); /* as long as rt_raster_from_wkb copies memory */
+    ctx->dealloc(wkb); /* as long as rt_raster_from_wkb copies memory */
 
     return r;
 }

Modified: spike/wktraster/rt_core/testwkb.c
===================================================================
--- spike/wktraster/rt_core/testwkb.c	2009-02-02 17:58:38 UTC (rev 3615)
+++ spike/wktraster/rt_core/testwkb.c	2009-02-02 18:06:53 UTC (rev 3616)
@@ -61,6 +61,8 @@
 /* would depend on machine endian...
     CHECK( ! strcmp(hexwkb, out) );
 */
+    rt_raster_destroy(ctx, raster);
+    free(out);
 
     /* ------------------------------------------------------ */
     /* No bands, 7x8 - big endian                             */
@@ -104,6 +106,9 @@
     CHECK( ! strcmp(hexwkb, out) );
 */
 
+    rt_raster_destroy(ctx, raster);
+    free(out);
+
     /* ------------------------------------------------------ */
     /* 1x1, little endian, band0(1bb)                         */
     /* ------------------------------------------------------ */
@@ -155,6 +160,9 @@
     CHECK( ! strcmp(hexwkb, out) );
 */
 
+    rt_raster_destroy(ctx, raster);
+    free(out);
+
     /* ------------------------------------------------------ */
     /* 3x2, big endian, band0(8BSI)                           */
     /* ------------------------------------------------------ */
@@ -216,6 +224,9 @@
     CHECK( ! strcmp(hexwkb, out) );
 */
 
+    rt_raster_destroy(ctx, raster);
+    free(out);
+
     /* ------------------------------------------------------ */
     /* 3x2, little endian, band0(16BSI)                       */
     /* ------------------------------------------------------ */
@@ -277,6 +288,8 @@
     CHECK( ! strcmp(hexwkb, out) );
 */
 
+    rt_raster_destroy(ctx, raster);
+    free(out);
 
     /* ------------------------------------------------------ */
     /* 3x2, big endian, band0(16BSI)                          */
@@ -339,6 +352,9 @@
     CHECK( ! strcmp(hexwkb, out) );
 */
 
+    rt_raster_destroy(ctx, raster);
+    free(out);
+
     /* ------------------------------------------------------ */
 
     printf("All tests successful !\n");



More information about the postgis-commits mailing list