[QGIS Commit] r10596 - trunk/qgis/src/providers/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Apr 19 05:12:29 EDT 2009


Author: jef
Date: 2009-04-19 05:12:29 -0400 (Sun, 19 Apr 2009)
New Revision: 10596

Modified:
   trunk/qgis/src/providers/grass/qgsgrassprovider.cpp
Log:
fix #1460

Modified: trunk/qgis/src/providers/grass/qgsgrassprovider.cpp
===================================================================
--- trunk/qgis/src/providers/grass/qgsgrassprovider.cpp	2009-04-19 08:32:36 UTC (rev 10595)
+++ trunk/qgis/src/providers/grass/qgsgrassprovider.cpp	2009-04-19 09:12:29 UTC (rev 10596)
@@ -1165,7 +1165,12 @@
 
     if ( mMaps[mapId].valid )
     {
+      bool mapsetunset = G__getenv( "MAPSET" )==NULL || *G__getenv( "MAPSET" )==0;
+      if( mapsetunset )
+        G__setenv(( char * )"MAPSET", mMaps[mapId].mapset.toAscii().data() );
       Vect_close( mMaps[mapId].map );
+      if( mapsetunset )
+        G__setenv(( char * )"MAPSET", "" );
     }
     mMaps[mapId].valid = false;
   }
@@ -1320,7 +1325,7 @@
     struct Key_Value *projunits = G_get_projunits();
     char *wkt = GPJ_grass_to_wkt( projinfo, projunits,  0, 0 );
     Wkt = QString( wkt );
-    free( wkt );
+    G_free( wkt );
   }
 
   setlocale( LC_NUMERIC, oldlocale );



More information about the QGIS-commit mailing list