From kde-devel Sun Dec 28 21:55:47 2003 From: Waldo Bastian Date: Sun, 28 Dec 2003 21:55:47 +0000 To: kde-devel Subject: Re: Possible memory leak in kfilebookmarkhandler.cpp X-MARC-Message: https://marc.info/?l=kde-devel&m=107264856830375 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_jF17/nwqJ2mdyTc" --Boundary-00=_jF17/nwqJ2mdyTc Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun December 28 2003 22:44, Waldo Bastian wrote: > On Sun December 28 2003 22:12, Albert Astals Cid wrote: > > Hi i think kfilebookmarkhandler.cpp is leaking some memory. > > [Snip] > > > So it says that m_bookmarkMenu should be deleted. > > > > This is when only using the open option one time, if used more times the > > number of leaked bytes grow. > > > > So i think m_bookmarkMenu should be deleted in the destructor (is alrea= dy > > there but commented) > > Yes, I think so too, unfortunately when doing that things starts to crash. > > Looking into it. > > Cheers, > Waldo This seems to fix it. Please review. Cheers, Waldo =2D --=20 bastian@kde.org -=3D|[ KDE: K Desktop for the Enterprise ]|=3D- bastian@sus= e.com =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/71FjN4pvrENfboIRAmm2AKCFMMKdy/JgKtQuQTZDpeil5x9TbgCgnAat MUo+USSRRiTSNQIQSIkaCCU=3D =3Da91Q =2D----END PGP SIGNATURE----- --Boundary-00=_jF17/nwqJ2mdyTc Content-Type: text/x-diff; charset="iso-8859-1"; name="bookmarkmenu_leak.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bookmarkmenu_leak.patch" Index: kfilebookmarkhandler.cpp =================================================================== RCS file: /home/kde/kdelibs/kio/kfile/kfilebookmarkhandler.cpp,v retrieving revision 1.8 diff -u -r1.8 kfilebookmarkhandler.cpp --- kfilebookmarkhandler.cpp 17 Mar 2003 23:23:47 -0000 1.8 +++ kfilebookmarkhandler.cpp 28 Dec 2003 21:51:31 -0000 @@ -56,7 +56,7 @@ KFileBookmarkHandler::~KFileBookmarkHandler() { - // delete m_bookmarkMenu; ### + delete m_bookmarkMenu; } QString KFileBookmarkHandler::currentURL() const Index: kfiledialog.cpp =================================================================== RCS file: /home/kde/kdelibs/kio/kfile/kfiledialog.cpp,v retrieving revision 1.365 diff -u -r1.365 kfiledialog.cpp --- kfiledialog.cpp 19 Dec 2003 14:29:04 -0000 1.365 +++ kfiledialog.cpp 28 Dec 2003 21:51:32 -0000 @@ -187,6 +187,7 @@ config->sync(); + delete d->bookmarkHandler; // Should be deleted before ops! delete ops; delete d; } --Boundary-00=_jF17/nwqJ2mdyTc Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_jF17/nwqJ2mdyTc--