minor leak with CustShrinkTabPager
Hi, thanks to Jeremy's valgrind log at http://starurchin.org/dillo/valgrind.html I noticed a minor leak with CustShrinkTabPager(). The TabGroup::pager() method internally clones the passed pager, so it must be deleted afterwards, e.g. like this: diff -r 9b0b8ae9b06a src/uicmd.cc --- a/src/uicmd.ccSun Mar 01 12:34:00 2009 +0100 +++ b/src/uicmd.ccMon Mar 02 08:57:02 2009 +0100 @@ -225,7 +225,9 @@ public: CustTabGroup (int x, int y, int ww, int wh, const char *lbl=0) : TabGroup(x,y,ww,wh,lbl) { - this->pager(new CustShrinkTabPager()); + CustShrinkTabPager *cp = new CustShrinkTabPager(); + this->pager(cp); + delete cp; toolTip = new Tooltip; tooltipEnabled = false; buttonPushed = false; Alternatively we could keep one copy around in a static member. Cheers, Johannes
On Mon, Mar 02, 2009 at 09:02:18AM +0100, Hofmann Johannes wrote:
Hi,
thanks to Jeremy's valgrind log at http://starurchin.org/dillo/valgrind.html I noticed a minor leak with CustShrinkTabPager().
The TabGroup::pager() method internally clones the passed pager, so it must be deleted afterwards, e.g. like this: [...]
Committed. -- Cheers Jorge.-
participants (2)
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de