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)
  • Loading branch information
nyalldawson committed May 1, 2018
1 parent b683291 commit 9ff366ff0f68b225e7516702a3ea780597fa84dc
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/app/qgisapp.cpp
@@ -2419,10 +2419,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 9ff366f

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