Skip to content

Commit d9a79c9

Browse files
rldhontm-kuhn
authored andcommitted
[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.
1 parent c66906d commit d9a79c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/qgsmaplayerregistry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ void QgsMapLayerRegistry::removeMapLayers( const QList<QgsMapLayer*>& layers )
144144
continue;
145145

146146
QString myId( lyr->id() );
147+
emit layerWillBeRemoved( myId );
148+
emit layerWillBeRemoved( lyr );
147149
if ( mOwnedLayers.contains( lyr ) )
148150
{
149-
emit layerWillBeRemoved( myId );
150-
emit layerWillBeRemoved( lyr );
151151
delete lyr;
152152
mOwnedLayers.remove( lyr );
153153
}

0 commit comments

Comments
 (0)