#8618 closed patch (fixed)
Patch: minor memory leak TabWidget.cpp
| Reported by: | SF/youngelf | Owned by: | fingolfin |
|---|---|---|---|
| Priority: | normal | Component: | GUI |
| Version: | 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)
Change History (5)
by , 19 years ago
| Attachment: | TabWidget-patch.cpp added |
|---|
comment:1 by , 19 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 , 19 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 , 19 years ago
| Owner: | set to |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
comment:4 by , 7 years ago
| Component: | → GUI |
|---|

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