[Marble-commits] KDE/kdeedu/marble/src/plugins/render/geodata
Patrick Spendrin
ps_ml at gmx.de
Sat Jul 11 17:15:28 CEST 2009
SVN commit 994857 by sengels:
use objects on the stack instead of casts to circumvent virtual function call crashes
M +7 -3 GeoRendererView.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/render/geodata/GeoRendererView.cpp #994856:994857
@@ -206,16 +206,20 @@
if( object->geometryId() == GeoDataPolygonId ) {
setBrushStyle( mapped );
setPenStyle( mapped );
- m_painter->drawPolygon( *static_cast<GeoDataPolygon*>( object ) );
+ // geometries are implicitly shared, this shouldn't hurt
+ GeoDataPolygon polygon( *static_cast<GeoDataPolygon*>( object ) );
+ m_painter->drawPolygon( polygon );
}
if( object->geometryId() == GeoDataLinearRingId ) {
m_painter->setBrush( QColor( 0, 0, 0, 0 ) );
setPenStyle( mapped );
- m_painter->drawPolygon( *static_cast<GeoDataLinearRing*>( object ) );
+ GeoDataLinearRing linearRing( *static_cast<GeoDataLinearRing*>( object ) );
+ m_painter->drawPolygon( linearRing );
}
if( object->geometryId() == GeoDataLineStringId ) {
setPenStyle( mapped );
- m_painter->drawPolyline( *static_cast<GeoDataLineString*>( object ) );
+ GeoDataLineString lineString( *static_cast<GeoDataLineString*>( object ) );
+ m_painter->drawPolyline( lineString );
}
/* Note: GeoDataMultiGeometry is handled within the model */
m_painter->restore();
More information about the Marble-commits
mailing list