Skip to content

Commit ffa2cfd

Browse files
committedDec 31, 2011
fix invalid list index in identify results causing wrong result or segfault accessing actions from context menu
1 parent 100d702 commit ffa2cfd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/app/qgsidentifyresults.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
460460
{
461461
mActionPopup->addSeparator();
462462

463+
int featIdx = featItem->data( 0, Qt::UserRole + 1 ).toInt();
464+
463465
// The assumption is made that an instance of QgsIdentifyResults is
464466
// created for each new Identify Results dialog box, and that the
465467
// contents of the popup menu doesn't change during the time that
@@ -471,7 +473,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
471473
if ( !action.runable() )
472474
continue;
473475

474-
QgsFeatureAction *a = new QgsFeatureAction( action.name(), mFeatures[ idx ], vlayer, i, idx, this );
476+
QgsFeatureAction *a = new QgsFeatureAction( action.name(), mFeatures[ featIdx ], vlayer, i, idx, this );
475477
mActionPopup->addAction( QgisApp::getThemeIcon( "/mAction.png" ), action.name(), a, SLOT( execute() ) );
476478
}
477479
}

0 commit comments

Comments
 (0)
Please sign in to comment.