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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 6 13:10:40 PDT 2012


Author: martinl
Date: 2012-08-06 13:10:39 -0700 (Mon, 06 Aug 2012)
New Revision: 52569

Modified:
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/lib/vector/Vlib/open_pg.c
Log:
vlib: fix clean up when creation of new vector map fails (pg)


Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2012-08-06 19:07:16 UTC (rev 52568)
+++ grass/trunk/lib/vector/Vlib/open.c	2012-08-06 20:10:39 UTC (rev 52569)
@@ -776,8 +776,7 @@
     Map->plus.spidx_with_z = Map->plus.with_z = Map->head.with_z = (with_z != 0);
 
     if ((*Open_new_array[Map->format][1]) (Map, name, with_z) < 0) {
-        G_fatal_error(_("Unable to create vector map <%s>"),
-                      name);
+        Vect_delete(name); /* clean up */
         return -1;
     }
 

Modified: grass/trunk/lib/vector/Vlib/open_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_pg.c	2012-08-06 19:07:16 UTC (rev 52568)
+++ grass/trunk/lib/vector/Vlib/open_pg.c	2012-08-06 20:10:39 UTC (rev 52569)
@@ -271,9 +271,9 @@
             }
         }
         else {
-            G_fatal_error(_("PostGIS layer <%s.%s> already exists in database '%s'"),
-                          pg_info->schema_name, pg_info->table_name,
-                          pg_info->db_name);
+            G_warning(_("PostGIS layer <%s.%s> already exists in database '%s'"),
+                      pg_info->schema_name, pg_info->table_name,
+                      pg_info->db_name);
             return -1;
         }
     }



More information about the grass-commit mailing list