Ticket #10807 (closed Patch - Bug Fix: Invalid)
Opened 13 months ago
Last modified 12 months ago
[PATCH] libmythui: Prevent memory leak and dangling reference to MythUIType children
|Reported by:||Lawrence Rust <lvr@…>||Owned by:||stuartm|
|Component:||MythTV - General||Version:||Master Head|
|Severity:||medium||Keywords:||MythUIType memory leak|
Although ownership of all MythUIType objects is transferred to the parent during construction, the MythUIType destructor doesn't delete its children, resulting in a memory leak found by valgrind.
Also, because of the ownership semantics, MythUIType's dtor should be protected. This uncovers a bug in MythUIButtonList::CopyFrom? which should use the base DeleteChild? (rather than a direct delete) otherwise a dangling reference is left.
This bug and patch apply to git master, fixes/0.25 and fixes/0.24 (maybe more).
P.S. IMHO the base class XMLParseBase of MythUIType should be protected otherwise it defeats abstraction.
Changed 13 months ago by Lawrence Rust <lvr@…>
- Attachment 0001-libmythui-Prevent-memory-leak-of-MythUIType-children.patch added
comment:1 Changed 13 months ago by stuartm
comment:2 Changed 13 months ago by Lawrence Rust <lvr@…>
comment:3 Changed 13 months ago by Lawrence Rust <lvr@…>
comment:4 Changed 13 months ago by Lawrence Rust <lvr@…>
comment:5 Changed 12 months ago by beirdo
- Owner set to stuartm
- Status changed from new to assigned
comment:6 Changed 12 months ago by stuartm
- Status changed from assigned to closed
- Resolution set to Invalid