[BUGFIX] Emit layerWillBeRemoved like layersWillBeRemoved (#3194)

The signal layerWillBeremoved is only emitted when the layer is owned by QgsMapLayerRegistry.

To fix it just move the emitted layerWilBeRemoved out of the scope of layers owned by QgsMapLayerRegistry.
This commit is contained in:
rldhont 2016-06-10 15:27:03 +02:00 committed by Matthias Kuhn
parent c66906dbe2
commit d9a79c9381

View File

@ -144,10 +144,10 @@ void QgsMapLayerRegistry::removeMapLayers( const QList<QgsMapLayer*>& layers )
continue;
QString myId( lyr->id() );
emit layerWillBeRemoved( myId );
emit layerWillBeRemoved( lyr );
if ( mOwnedLayers.contains( lyr ) )
{
emit layerWillBeRemoved( myId );
emit layerWillBeRemoved( lyr );
delete lyr;
mOwnedLayers.remove( lyr );
}