Skip to content

Commit

Permalink
fix crash on quit
Browse files Browse the repository at this point in the history
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 a7bae8c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/qgsmaplayerregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7bae8c

Please sign in to comment.