Opened 13 years ago

Closed 13 years ago

Last modified 13 months ago

#8618 closed patch (fixed)

Patch: minor memory leak TabWidget.cpp

Reported by: SF/youngelf Owned by: fingolfin
Priority: normal Component: GUI
Keywords: Cc:
Game:

Description

Hi,

A minor new without delete in TabWidget.cpp. It is strange that _navRight needs to be free'd, but if I try to free _navLeft as well, then valgrind complains about free'ing an unallocated chunk.

Vikram Aggarwal
vikram@mayin.org

Ticket imported from: #1682305. Ticket imported from: patches/723.

Attachments (1)

TabWidget-patch.cpp (675 bytes ) - added by SF/youngelf 13 years ago.
Patch for gui/TabWidget.cpp against the recent svn release

Download all attachments as: .zip

Change History (5)

by SF/youngelf, 13 years ago

Attachment: TabWidget-patch.cpp added

Patch for gui/TabWidget.cpp against the recent svn release

comment:1 by fingolfin, 13 years ago

That's because the widgets are chained; if you delete one, it'll automatically delete all it's successors.

The proper fix for this issue is to modify the GuiObject class, by adding a destructor like this:

~GuiObject() { delete _firstWidget; _firstWidget = 0; }

comment:2 by fingolfin, 13 years ago

I fixed the GUI code to properly delete all children of all GuiObjects (I hope), this should in particular fix the leak described here.

comment:3 by fingolfin, 13 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:4 by digitall, 13 months ago

Component: GUI
Note: See TracTickets for help on using tickets.