Issue 120662 - The slave SvXMLImportContext object for SdXMLNumberFormatMemberImportContext is always leaked
Summary: The slave SvXMLImportContext object for SdXMLNumberFormatMemberImportContext ...
Status: CLOSED FIXED
Alias: None
Product: performance
Classification: Code
Component: code (show other issues)
Version: AOO 3.4.0
Hardware: All All
: P2 Normal (vote)
Target Milestone: 4.0.0
Assignee: zhang jianfang
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 120975
  Show dependency tree
 
Reported: 2012-08-22 12:45 UTC by zhang jianfang
Modified: 2016-04-09 10:38 UTC (History)
0 users

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


Attachments
fix code patch (368 bytes, patch)
2012-08-22 12:50 UTC, zhang jianfang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zhang jianfang 2012-08-22 12:45:47 UTC
In api,

SvXMLImportContext * SdXMLNumberFormatImportContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList )
{
	return new SdXMLNumberFormatMemberImportContext( GetImport(), nPrefix, rLocalName, xAttrList, this, SvXMLNumFormatContext::CreateChildContext( nPrefix, rLocalName, xAttrList ) );
}

The SvXMLImportContext created by SvXMLNumFormatContext::CreateChildContext( nPrefix, rLocalName, xAttrList ) is never released anywhere.


This memory leak can be observed when loading any odf documents needs number format.
Comment 1 zhang jianfang 2012-08-22 12:50:14 UTC
Created attachment 79067 [details]
fix code patch

Change mpSlaveContext to shared_ptr, so it can be release automatically in SvXMLNumFormatContext destructor.
Comment 2 zhang jianfang 2012-09-03 02:53:18 UTC
Comment on attachment 79067 [details]
fix code patch

Remove review tag
Comment 3 zhang jianfang 2012-09-03 02:54:46 UTC
Committed by revision 1380115.
Comment 4 Marcus 2016-04-09 10:38:20 UTC
fixed in 4.0.0