Skip to content

Commit 0fb356e

Browse files
committedAug 26, 2015
[GRASS] made ready for Vect_new_map_struct
1 parent 18a797c commit 0fb356e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,20 @@ struct Map_info *QgsGrass::vectNewMapStruct()
24532453
// -> allocate more space on all systems
24542454

24552455
// TODO: replace by Vect_new_map_struct once it appears in GRASS
2456+
// Patch supplied: https://trac.osgeo.org/grass/ticket/2729
2457+
#if GRASS_VERSION_MAJOR > 999
2458+
G_TRY
2459+
{
2460+
return Vect_new_map_struct();
2461+
}
2462+
G_CATCH( QgsGrass::Exception &e ) // out of memory
2463+
{
2464+
warning( e );
2465+
return 0;
2466+
}
2467+
#else
24562468
return ( struct Map_info* ) qgsMalloc( 2*sizeof( struct Map_info ) );
2469+
#endif
24572470
}
24582471

24592472
void QgsGrass::vectDestroyMapStruct( struct Map_info *map )

0 commit comments

Comments
 (0)
Please sign in to comment.