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 committed Jun 10, 2016
1 parent 9494dce commit f6aad8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsmaplayerregistry.cpp
Original file line number Diff line number Diff line change
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

1 comment on commit f6aad8b

@mhugent
Copy link
Contributor

@mhugent mhugent commented on f6aad8b Sep 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug https://hub.qgis.org/issues/15522 has been bisected down to this commit

Please sign in to comment.