[GRASS-SVN] r54866 - grass/trunk/lib/ogsf
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 3 04:13:54 PST 2013
Author: mmetz
Date: 2013-02-03 04:13:54 -0800 (Sun, 03 Feb 2013)
New Revision: 54866
Modified:
grass/trunk/lib/ogsf/gvl_calc.c
Log:
ogsf lib: fix initialization
Modified: grass/trunk/lib/ogsf/gvl_calc.c
===================================================================
--- grass/trunk/lib/ogsf/gvl_calc.c 2013-02-03 11:45:25 UTC (rev 54865)
+++ grass/trunk/lib/ogsf/gvl_calc.c 2013-02-03 12:13:54 UTC (rev 54866)
@@ -602,6 +602,13 @@
for (i = 0; i < gvol->n_isosurfs; i++) {
isosurf = gvol->isosurf[i];
+ /* initialize read/write buffers */
+ dbuff[i].old = NULL;
+ dbuff[i].new = NULL;
+ dbuff[i].ndx_old = 0;
+ dbuff[i].ndx_new = 0;
+ dbuff[i].num_zero = 0;
+
need_update[i] = 0;
for (a = 1; a < MAX_ATTS; a++) {
if (isosurf->att[a].changed) {
@@ -632,12 +639,8 @@
}
if (need_update[i]) {
- /* initialize read/write buffers */
+ /* set data buffer */
dbuff[i].old = isosurf->data;
- dbuff[i].new = NULL;
- dbuff[i].ndx_old = 0;
- dbuff[i].ndx_new = 0;
- dbuff[i].num_zero = 0;
}
}
@@ -681,6 +684,8 @@
gvl_write_char(dbuff[i].ndx_new++, &(dbuff[i].new),
dbuff[i].num_zero);
+ if (dbuff[i].old == isosurf->data)
+ dbuff[i].old = NULL;
G_free(isosurf->data);
gvl_align_data(dbuff[i].ndx_new, dbuff[i].new);
isosurf->data = dbuff[i].new;
@@ -716,6 +721,8 @@
}
}
}
+
+ /* TODO: G_free() dbuff and need_update ??? */
return (1);
}
More information about the grass-commit
mailing list