Skip to content
Permalink
Browse files
fix crash on quit
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14926 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 16, 2010
1 parent b196d98 commit a7bae8c2c83acc80011fb50603d8771312887480
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/core/qgsmaplayerregistry.cpp
@@ -102,19 +102,19 @@ void QgsMapLayerRegistry::removeMapLayer( QString theLayerId, bool theEmitSignal
void QgsMapLayerRegistry::removeAllMapLayers()
{
// moved before physically removing the layers
emit removedAll(); // now let all canvas Observers know to clear
// themselves, and then consequently any of
// their map legends
emit removedAll();

QMap<QString, QgsMapLayer *>::iterator it;
for ( it = mMapLayers.begin(); it != mMapLayers.end() ; ++it )
// now let all canvas observers know to clear themselves,
// and then consequently any of their map legends
while ( mMapLayers.size() > 0 )
{
emit layerWillBeRemoved( it.key() );
delete it.value(); // delete the map layer
mMapLayers.remove( it.key() );
QString id = mMapLayers.begin().key();
emit layerWillBeRemoved( id );
delete mMapLayers[ id ]; // delete the map layer
mMapLayers.remove( id );
}
mMapLayers.clear();

mMapLayers.clear();
} // QgsMapLayerRegistry::removeAllMapLayers()

//Added in QGIS 1.4

0 comments on commit a7bae8c

Please sign in to comment.