]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Fix a QAction leak (#5008)
authorJocelyn Turcotte <jturcotte@woboq.com>
Mon, 27 Jun 2016 14:22:51 +0000 (16:22 +0200)
committerGitHub <noreply@github.com>
Mon, 27 Jun 2016 14:22:51 +0000 (16:22 +0200)
Attach the accout menu QAction to the menu rather than the
ownCloudGui since it should be destroyed when the context
menu is cleared.

src/gui/owncloudgui.cpp

index 12f68387075385ae500f5212eb91d7b277669dad..26ef134c93cc2139c03d4216a6a6bd3fe17defa6 100644 (file)
@@ -367,7 +367,7 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
             menu->addAction(tr("Managed Folders:"))->setDisabled(true);
         }
 
-        QAction *action = new QAction( tr("Open folder '%1'").arg(folder->shortGuiLocalPath()), this );
+        QAction *action = new QAction( tr("Open folder '%1'").arg(folder->shortGuiLocalPath()), menu );
         connect(action, SIGNAL(triggered()),_folderOpenActionMapper, SLOT(map()));
         _folderOpenActionMapper->setMapping( action, folder->alias() );
         menu->addAction(action);