Skip to content

Commit

Permalink
[BUGFIX] Emit layerWillBeRemoved like layersWillBeRemoved (#3194)
Browse files Browse the repository at this point in the history
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 d9a79c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsmaplayerregistry.cpp
Expand Up @@ -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 );
}
Expand Down

0 comments on commit d9a79c9

Please sign in to comment.