Skip to content

Commit 8221883

Browse files
committedFeb 12, 2020
Fix crash in server feature info due to storing incorrect reference to temporary
Seriously, auto is just plain dangerous and makes for fragile code. Let's all just stop using it PLEASE? (cherry picked from commit b3f37fd)
1 parent 014ea41 commit 8221883

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,13 +1262,13 @@ namespace QgsWms
12621262
if ( ! mContext.parameters().queryLayersNickname().contains( queryLayer ) )
12631263
{
12641264
// Find which group this layer belongs to
1265-
const auto &constNicks { mContext.parameters().queryLayersNickname() };
1266-
for ( const auto &ql : constNicks )
1265+
const QStringList constNicks { mContext.parameters().queryLayersNickname() };
1266+
for ( const QString &ql : constNicks )
12671267
{
12681268
if ( mContext.layerGroups().contains( ql ) )
12691269
{
1270-
const auto &constLayers { mContext.layerGroups()[ql] };
1271-
for ( const auto &ml : constLayers )
1270+
const QList<QgsMapLayer *> constLayers { mContext.layerGroups()[ql] };
1271+
for ( const QgsMapLayer *ml : constLayers )
12721272
{
12731273
if ( ( ! ml->shortName().isEmpty() && ml->shortName() == queryLayer ) || ( ml->name() == queryLayer ) )
12741274
{

0 commit comments

Comments
 (0)
Please sign in to comment.