[GRASS-SVN] r54935 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 5 07:31:53 PST 2013
Author: mmetz
Date: 2013-02-05 07:31:53 -0800 (Tue, 05 Feb 2013)
New Revision: 54935
Modified:
grass/trunk/lib/vector/Vlib/cindex.c
grass/trunk/lib/vector/Vlib/close.c
grass/trunk/lib/vector/Vlib/open.c
Log:
Vlib: simplify init/free of support structures
Modified: grass/trunk/lib/vector/Vlib/cindex.c
===================================================================
--- grass/trunk/lib/vector/Vlib/cindex.c 2013-02-05 15:30:43 UTC (rev 54934)
+++ grass/trunk/lib/vector/Vlib/cindex.c 2013-02-05 15:31:53 UTC (rev 54935)
@@ -513,7 +513,6 @@
}
/* load category index to memory */
- dig_cidx_init(Plus);
ret = dig_read_cidx(&fp, Plus, head_only);
fclose(fp.file);
Modified: grass/trunk/lib/vector/Vlib/close.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close.c 2013-02-05 15:30:43 UTC (rev 54934)
+++ grass/trunk/lib/vector/Vlib/close.c 2013-02-05 15:31:53 UTC (rev 54935)
@@ -172,14 +172,8 @@
fclose(Map->plus.spidx_fp.file);
}
if (Map->level > 1 && Map->plus.release_support) {
- G_debug(1, "free topology");
+ G_debug(1, "free topology, spatial index, and category index");
dig_free_plus(&(Map->plus));
-
- G_debug(1, "free spatial index");
- dig_spidx_free(&(Map->plus));
-
- G_debug(1, "free category index");
- dig_cidx_free(&(Map->plus));
}
G_debug(1, "close history file");
Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c 2013-02-05 15:30:43 UTC (rev 54934)
+++ grass/trunk/lib/vector/Vlib/open.c 2013-02-05 15:31:53 UTC (rev 54935)
@@ -347,7 +347,6 @@
"cidx file for vector '%s' not available.",
Vect_get_full_name(Map));
dig_free_plus(&(Map->plus)); /* free topology */
- dig_spidx_free(&(Map->plus)); /* free spatial index */
level = 1;
}
else if (ret == -1) { /* file exists, but cannot be opened */
@@ -360,8 +359,6 @@
if (level == 2 && Map->format == GV_FORMAT_OGR) {
if (V2_open_old_ogr(Map) < 0) {
dig_free_plus(&(Map->plus));
- dig_spidx_free(&(Map->plus));
- dig_cidx_free(&(Map->plus));
level = 1;
}
}
@@ -372,8 +369,6 @@
if (level == 2 && Map->format == GV_FORMAT_POSTGIS) {
if (V2_open_old_pg(Map) < 0) {
dig_free_plus(&(Map->plus));
- dig_spidx_free(&(Map->plus));
- dig_cidx_free(&(Map->plus));
level = 1;
}
}
@@ -398,8 +393,6 @@
if (0 != (*Open_old_array[format][1]) (Map, update)) { /* cannot open */
if (level >= 2) { /* support files opened */
dig_free_plus(&(Map->plus));
- dig_spidx_free(&(Map->plus));
- dig_cidx_free(&(Map->plus));
}
if (level_request == 0)
G_fatal_error(_("Unable to open vector map <%s>"),
@@ -428,8 +421,6 @@
if (level < 2 && Map->head.with_z) {
/* topo has been initialized as 2D, update to 3D */
dig_free_plus(&(Map->plus));
- dig_spidx_free(&(Map->plus));
- dig_cidx_free(&(Map->plus));
Map->plus.with_z = Map->head.with_z;
dig_init_plus(&(Map->plus));
More information about the grass-commit
mailing list