[GRASS-SVN] r55707 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 11 11:46:30 PDT 2013


Author: martinl
Date: 2013-04-11 11:46:30 -0700 (Thu, 11 Apr 2013)
New Revision: 55707

Modified:
   grass/trunk/lib/vector/Vlib/close.c
   grass/trunk/lib/vector/Vlib/close_nat.c
Log:
vlib: fix r55681 side-affect for external formats (Vect__delete() recursive call)


Modified: grass/trunk/lib/vector/Vlib/close.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close.c	2013-04-11 18:22:45 UTC (rev 55706)
+++ grass/trunk/lib/vector/Vlib/close.c	2013-04-11 18:46:30 UTC (rev 55707)
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+
 #include <grass/vector.h>
 #include <grass/glocale.h>
 
@@ -218,10 +219,6 @@
 	}
     }
 
-    if (Map->temporary) {
-        Vect__delete(Map->name, TRUE);
-    }
-
     G_free(Map->name);
     G_free(Map->mapset);
     G_free(Map->location);

Modified: grass/trunk/lib/vector/Vlib/close_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close_nat.c	2013-04-11 18:22:45 UTC (rev 55706)
+++ grass/trunk/lib/vector/Vlib/close_nat.c	2013-04-11 18:46:30 UTC (rev 55707)
@@ -5,7 +5,7 @@
 
    Higher level functions for reading/writing/manipulating vectors.
 
-   (C) 2001-2009 by the GRASS Development Team
+   (C) 2001-2009, 2013 by the GRASS Development Team
 
    This program is free software under the GNU General Public License
    (>=v2).  Read the file COPYING that comes with GRASS for details.
@@ -15,10 +15,13 @@
 */
 
 #include <stdlib.h>
+
 #include <grass/vector.h>
 
+#include "local_proto.h"
+
 /*!
-  \brief Close vector map file
+  \brief Close vector map
 
   \param Map vector map to be closed
   
@@ -47,5 +50,10 @@
     fclose(Map->dig_fp.file);
     dig_file_free(&(Map->dig_fp));
 
+    /* delete temporary map */
+    if (Map->temporary) {
+        Vect__delete(Map->name, TRUE);
+    }
+
     return 0;
 }



More information about the grass-commit mailing list