Skip to content

Commit c772a06

Browse files
author
jef
committed
fix #1460
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10596 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ba0a1eb commit c772a06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/providers/grass/qgsgrassprovider.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,12 @@ void QgsGrassProvider::closeMap( int mapId )
11651165

11661166
if ( mMaps[mapId].valid )
11671167
{
1168+
bool mapsetunset = G__getenv( "MAPSET" )==NULL || *G__getenv( "MAPSET" )==0;
1169+
if( mapsetunset )
1170+
G__setenv(( char * )"MAPSET", mMaps[mapId].mapset.toAscii().data() );
11681171
Vect_close( mMaps[mapId].map );
1172+
if( mapsetunset )
1173+
G__setenv(( char * )"MAPSET", "" );
11691174
}
11701175
mMaps[mapId].valid = false;
11711176
}
@@ -1320,7 +1325,7 @@ QgsCoordinateReferenceSystem QgsGrassProvider::crs()
13201325
struct Key_Value *projunits = G_get_projunits();
13211326
char *wkt = GPJ_grass_to_wkt( projinfo, projunits, 0, 0 );
13221327
Wkt = QString( wkt );
1323-
free( wkt );
1328+
G_free( wkt );
13241329
}
13251330

13261331
setlocale( LC_NUMERIC, oldlocale );

0 commit comments

Comments
 (0)