Skip to content
Permalink
Browse files

[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.
  • Loading branch information
rldhont authored and m-kuhn committed Jun 10, 2016
1 parent c66906d commit d9a79c9381ec2bd8b787edc3c72a7b96b84917d5
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsmaplayerregistry.cpp
@@ -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 );
}

0 comments on commit d9a79c9

Please sign in to comment.
You can’t perform that action at this time.