Issue 120073 - [From Symphony] There is a memory leak in function SvXMLImportItemMapper::PutXMLValue
[From Symphony] There is a memory leak in function SvXMLImportItemMapper::Put...
Status: CLOSED FIXED
Product: performance
Classification: Code
Component: code
AOO 3.4.0
All All
: P3 normal (vote)
: AOO 4.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks: 120975 121366
  Show dependency treegraph
 
Reported: 2012-06-25 03:01 UTC by ChaoHuang
Modified: 2013-02-16 09:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
for file "main/sw/source/filter/xml/xmlimpit.cxx" (510 bytes, patch)
2012-06-25 03:05 UTC, ChaoHuang
chao.dev.h: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description ChaoHuang 2012-06-25 03:01:23 UTC
Code snippet
-------------------------------------------------------------------------
        case RES_FRAMEDIR:
        {
            const XMLPropertyHandler* pWritingModeHandler =
                XMLPropertyHandlerFactory::CreatePropertyHandler(
                    XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT );
            if( pWritingModeHandler != NULL )
            {
                Any aAny;
                bOk = pWritingModeHandler->importXML( rValue, aAny,
                                                      rUnitConverter );
                if( bOk )
                    bOk = rItem.PutValue( aAny );
            }
        }
        break;

The object pWritingModeHandler is created in function XMLPropertyHandlerFactory::CreatePropertyHandler on heap. But it will not be released. So it is a memory leak.
Comment 1 ChaoHuang 2012-06-25 03:05:34 UTC
Created attachment 78452 [details]
for file "main/sw/source/filter/xml/xmlimpit.cxx"
Comment 2 ChaoHuang 2012-06-25 03:05:57 UTC
Need to free pWritingModeHandler explicitly.
Comment 3 hdu@apache.org 2012-06-25 10:01:23 UTC
Thanks for the patch! Applied as 1353449.
Comment 4 Yan Ji 2012-11-30 04:47:33 UTC
Since last SVT(r1400866) shows there is no memory leak, so close this defect as resolved.