owncloudgui: Fix a small leak

The systray icon were not destroyed while qutting
This commit is contained in:
Olivier Goffart 2014-10-15 18:11:18 +02:00
parent 10175c8d57
commit 2bba4134fb
2 changed files with 4 additions and 5 deletions

View File

@ -50,7 +50,6 @@ ownCloudGui::ownCloudGui(Application *parent) :
_settingsDialog(new SettingsDialog(this)),
#endif
_logBrowser(0),
_contextMenu(0),
_recentActionsMenu(0),
_folderOpenActionMapper(new QSignalMapper(this)),
_recentItemsMapper(new QSignalMapper(this)),
@ -303,11 +302,11 @@ void ownCloudGui::setupContextMenu()
_recentActionsMenu->addAction(tr("None."));
_recentActionsMenu->addAction(_actionRecent);
} else {
_contextMenu = new QMenu(_contextMenu);
_recentActionsMenu = new QMenu(tr("Recent Changes"));
_contextMenu.reset(new QMenu());
_recentActionsMenu = new QMenu(tr("Recent Changes"), _contextMenu.data());
// this must be called only once after creating the context menu, or
// it will trigger a bug in Ubuntu's SNI bridge patch (11.10, 12.04).
_tray->setContextMenu(_contextMenu);
_tray->setContextMenu(_contextMenu.data());
}
_contextMenu->setTitle(Theme::instance()->appNameGUI() );
_contextMenu->addAction(_actionOpenoC);

View File

@ -85,7 +85,7 @@ private:
#endif
QPointer<LogBrowser>_logBrowser;
// tray's menu
QMenu *_contextMenu;
QScopedPointer<QMenu> _contextMenu;
QMenu *_recentActionsMenu;
QAction *_actionLogin;