[mapguide-trac] #830: RichTextEngine leaks memory
MapGuide Open Source
trac_mapguide at osgeo.org
Mon Jan 26 18:11:19 EST 2009
#830: RichTextEngine leaks memory
----------------------------+-----------------------------------------------
Reporter: waltweltonlair | Owner: waltweltonlair
Type: defect | Status: assigned
Priority: high | Milestone: 2.1
Component: Server | Version: 2.0.1
Severity: critical | Resolution:
Keywords: | External_id: 1122052.01
----------------------------+-----------------------------------------------
Comment (by waltweltonlair):
The memory leaks have been addressed:
* The !RichTextEngine destructor was missing a call to delete its
m_pCurrLine !AtomLine object.
* The destructors for the !AtomBaseComponent,
!AtomBaseComponentCollection, !AtomRun, !AtomLine, and !AtomBlock classes
need to be virtual, so that calling delete on a base class calls the
destructor on the most derived class.
* Code in RichTextEngine::Parse which closed any open blocks was only
executing if the parse succeeded. The code now executes regardless of
whether the parse succeeded; we always want open blocks to be closed so
that the memory gets freed correctly.
* Updated some code in RichTextEngine::!TextRun which was unnecessarily
malloc'ing an array of two characters.
* In the !AtomRun destructor, replaced a call to delete a malloc'ed
pointer with a call to free.
* In AtomRun::!OutputData, call free on the malloc'ed pointer before
clearing it.
--
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/830#comment:2>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals
More information about the mapguide-trac
mailing list