[mythtv-commits] Ticket #10807: [PATCH] libmythui: Prevent memory leak and dangling reference to MythUIType children
MythTV
noreply at mythtv.org
Wed Jun 6 11:10:49 UTC 2012
#10807: [PATCH] libmythui: Prevent memory leak and dangling reference to MythUIType
children
------------------------------------+----------------------------------
Reporter: Lawrence Rust <lvr@…> | Type: Patch - Bug Fix
Status: new | Priority: minor
Milestone: unknown | Component: MythTV - General
Version: Master Head | Severity: medium
Keywords: MythUIType memory leak | Ticket locked: 0
------------------------------------+----------------------------------
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.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/10807>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list