Skip to content
Permalink
Browse files

fix crash in identify menu when closing a project with map layer actions

  • Loading branch information
3nids committed Sep 18, 2014
1 parent 5645a18 commit faf4b7f49ba67d0e6e110632bf85145ed570583e
Showing with 16 additions and 3 deletions.
  1. +16 −3 src/gui/qgsidentifymenu.cpp
@@ -136,10 +136,23 @@ QList<QgsMapToolIdentify::IdentifyResult> QgsIdentifyMenu::exec( const QList<Qgs
bool externalAction;
returnResults = results( selectedAction, externalAction );

// delete actions
clear();
// also remove the QgsActionMenu
QList<QgsActionMenu*> actionMenus = findChildren<QgsActionMenu*>();
Q_FOREACH ( QgsActionMenu* actionMenu, actionMenus )

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Sep 18, 2014

Member

Small side-note, there is a nice shortcut for this:
qDeleteAll( actionMenus );

This comment has been minimized.

Copy link
@3nids

3nids Sep 18, 2014

Author Member

thanks!

{
delete actionMenu;
}

if ( externalAction && !mResultsIfExternalAction )
{
return QList<QgsMapToolIdentify::IdentifyResult>();

return returnResults;
}
else
{
return returnResults;
}
}

void QgsIdentifyMenu::addRasterLayer( QgsMapLayer* layer )
@@ -316,7 +329,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer* layer, const QList<QgsMapT
QList<QgsMapLayerAction*> customFeatureActions = mCustomActionRegistry.mapLayerActions( layer, QgsMapLayerAction::SingleFeature );
if ( mShowFeatureActions )
{
featureActionMenu = new QgsActionMenu( layer, &( result.mFeature ), this );
featureActionMenu = new QgsActionMenu( layer, &( result.mFeature ), layerMenu );
}

// feature title

0 comments on commit faf4b7f

Please sign in to comment.
You can’t perform that action at this time.