summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkprovider.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-10-13 21:15:31 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-10-13 21:15:31 +0200
commitb75b89e99973b25db23d448703135e68472b88c6 (patch)
treed4ab73ad50e48952de8b0339d9ef93b0ef5c7b47 /src/bookmarks/bookmarkprovider.cpp
parentEnabling WebKit Page Cache feature: please, refers to (diff)
downloadrekonq-b75b89e99973b25db23d448703135e68472b88c6.tar.xz
Fix mem leak, due to kbookmarkmenu class.
Please, see http://svn.reviewboard.kde.org/r/5606/ about.
Diffstat (limited to 'src/bookmarks/bookmarkprovider.cpp')
-rw-r--r--src/bookmarks/bookmarkprovider.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkprovider.cpp
index beca5475..ccdc3269 100644
--- a/src/bookmarks/bookmarkprovider.cpp
+++ b/src/bookmarks/bookmarkprovider.cpp
@@ -97,6 +97,7 @@ BookmarkProvider::BookmarkProvider(QObject *parent)
BookmarkProvider::~BookmarkProvider()
{
+ qDeleteAll(m_bookmarkMenus);
delete m_manager;
}
@@ -109,8 +110,9 @@ KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent)
KActionMenu *bookmarkActionMenu = new KActionMenu(menu);
bookmarkActionMenu->setMenu(menu);
bookmarkActionMenu->setText(i18n("&Bookmarks"));
- new BookmarkMenu(m_manager, m_owner, menu, m_actionCollection);
-
+ BookmarkMenu *bMenu = new BookmarkMenu(m_manager, m_owner, menu, m_actionCollection);
+ m_bookmarkMenus.append(bMenu);
+
kDebug() << "new Bookmarks menu... DONE";
return bookmarkActionMenu;
@@ -222,8 +224,9 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar)
{
KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), this);
menuAction->setDelayed(false);
- new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address());
-
+ BookmarkMenu *bMenu = new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address());
+ m_bookmarkMenus.append(bMenu);
+
connect(menuAction->menu(), SIGNAL(aboutToShow()), toolBar, SLOT(menuDisplayed()));
connect(menuAction->menu(), SIGNAL(aboutToHide()), toolBar, SLOT(menuHidden()));