Skip to content
Permalink
Browse files
Fix memory leak
Code looks valid, but valgrind is reporting a leak here. In any
case Qt docs suggest not to use addAction and parent the
actions to the QActionGroup instead, so let's do that (and
it solves the reported leak)

(cherry-picked from 9ff366f)
  • Loading branch information
nyalldawson committed May 3, 2018
1 parent 14f0a83 commit c5e7998eef0ef496208e1bce5751841ae4477b6e
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/app/qgisapp.cpp
@@ -2351,10 +2351,9 @@ void QgisApp::refreshProfileMenu()
Q_FOREACH ( const QString &name, userProfileManager()->allProfiles() )
{
std::unique_ptr< QgsUserProfile > namedProfile( userProfileManager()->profileForName( name ) );
QAction *action = new QAction( namedProfile->icon(), namedProfile->alias(), mConfigMenu );
QAction *action = new QAction( namedProfile->icon(), namedProfile->alias(), profileGroup );
action->setToolTip( namedProfile->folder() );
action->setCheckable( true );
profileGroup->addAction( action );
mConfigMenu->addAction( action );

if ( name == activeName )

0 comments on commit c5e7998

Please sign in to comment.