Skip to content

Commit

Permalink
no modify original geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Jun 13, 2014
1 parent 10e7758 commit dfa03e8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/core/qgspallabeling.cpp
Expand Up @@ -1928,15 +1928,12 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
if ( geom->type() == QGis::Polygon && !geom->isGeosValid() )
{
QgsGeometry* bufferGeom = geom->buffer( 0, 0 );

if ( bufferGeom )
if ( !bufferGeom )
{
size_t wkbSize = bufferGeom->wkbSize();
unsigned char* wkb = ( unsigned char* )malloc( wkbSize );
memcpy( wkb, bufferGeom->asWkb(), wkbSize );
geom->fromWkb( wkb, wkbSize );
delete bufferGeom;
return;
}
geom = bufferGeom;
clonedGeometry.reset( geom );
}

// CLIP the geometry if it is bigger than the extent
Expand Down

0 comments on commit dfa03e8

Please sign in to comment.