Apache OpenOffice (AOO) Bugzilla – Issue 113748
xmloff: When saving odp documents, many SvxUnoNumberingRules objects which are put into the pool leaks in xmloff module
Last modified: 2011-01-24 09:24:03 UTC
The memory leak problem can be easily recreated by saving any .odp documents. Depends on how many pages and styles, the leaked mmeory varies. The SvxUnoNumberingRules are created with below call stack, svxmi!SvxUnoNumberingRules::SvxUnoNumberingRules+0000006D (z:\impr\svx\source\unodraw\unonrule.cxx, 166) svxmi!SvxCreateNumRule+0000002E (z:\impr\svx\source\unodraw\unonrule.cxx, 622) svxmi!SvxUnoTextRangeBase::GetPropertyValueHelper+00000162 (z:\impr\svx\source\unoedit\unotext.cxx, 699) svxmi!SvxUnoTextRangeBase::getPropertyValue+00000487 (z:\impr\svx\source\unoedit\unotext.cxx, 671) svxmi!SvxUnoTextRangeBase::_getPropertyValues+00000272 (z:\impr\svx\source\unoedit\unotext.cxx, 965) svxmi!SvxUnoTextContent::getPropertyValues+0000002B (z:\impr\svx\source\unoedit\unotext2.cxx, 350) xomi!MultiPropertySetHelper::getValues+0000002E (z:\lib\xmloff\source\style\multipropertysethelper.cxx, 158) xomi!MultiPropertySetHelper::getValue+00000091 (z:\lib\xmloff\source\style\multipropertysethelper.cxx, 196) xomi!XMLTextParagraphExport::Add+00000158 (z:\lib\xmloff\source\text\txtparae.cxx, 397) xomi!XMLTextParagraphExport::exportParagraph+000001A6 (z:\lib\xmloff\source\text\txtparae.cxx, 2003) xomi!XMLTextParagraphExport::exportTextContentEnumeration+00000484 (z:\lib\xmloff\source\text\txtparae.cxx, 1897) xomi!XMLTextParagraphExport::exportText+00000277 (z:\lib\xmloff\source\text\txtparae.cxx, 1767) xomi!XMLShapeExport::collectShapeAutoStyles+0000059A (z:\lib\xmloff\source\draw\shapeexport.cxx, 269) xomi!XMLShapeExport::collectShapesAutoStyles+000000E0 (z:\lib\xmloff\source\draw\shapeexport.cxx, 911) xomi!SdXMLExport::CollectDrawPageAutoStyles+00000341 (z:\lib\xmloff\source\draw\sdxmlexp.cxx, 2609) xomi!SdXMLExport::_ExportAutoStyles+00000E86 (z:\lib\xmloff\source\draw\sdxmlexp.cxx, 3431) xomi!SvXMLExport::ImplExportAutoStyles+000003DB (z:\lib\xmloff\source\core\xmlexp.cxx, 1214) xomi!SvXMLExport::exportDoc+00000ED1 (z:\lib\xmloff\source\core\xmlexp.cxx, 1493) xomi!SdXMLExport::exportDoc+00000554 (z:\lib\xmloff\source\draw\sdxmlexp.cxx, 2395) xomi!SvXMLExport::filter+000001BC (z:\lib\xmloff\source\core\xmlexp.cxx, 941) sdmi!SdXMLFilter::Export+00002636 (z:\impr\sd\source\filter\xml\sdxmlwrp.cxx, 1235) sdmi!sd::DrawDocShell::SaveAs+0000085C (z:\impr\sd\source\ui\docshell\docshel4.cxx, 683) sfxmi!SfxObjectShell::SaveAsOwnFormat+000000E2 (z:\lib\sfx2\source\doc\objstor.cxx, 3331) sdmi!sd::DrawDocShell::SaveAsOwnFormat+000001A1 (z:\impr\sd\source\ui\docshell\docshel4.cxx, 1253) sfxmi!SfxObjectShell::SaveTo_Impl+000012E4 (z:\lib\sfx2\source\doc\objstor.cxx, 1639) sfxmi!SfxObjectShell::PreDoSaveAs_Impl+0000031C (z:\lib\sfx2\source\doc\objstor.cxx, 3028) sfxmi!SfxObjectShell::CommonSaveAs_Impl+000007E4 (z:\lib\sfx2\source\doc\objstor.cxx, 287 The root cause is the SvxUnoNumberingRules objects referred by XMLTextListAutoStylePoolEntry_Impl objects, which is put into XMLTextListAutoStylePool in api XMLTextListAutoStylePool::Add(), but they are not freed correctly when the pool object freed. The fix is quite straightforward.
Created attachment 71021 [details] fix code patch file (Based on OOo3.1M11 code)
XMLTextListAutoStylePool.pNames may also have leaks, but don't know the condition to make it happen. You may have a check too.
Christian, please take over
zhangjfibm, nice catch, thanks for the contribution XMLTextListAutoStylePool.pNames also leaks but it is only used in writer documents with bullets in paragraphs. I fixed this accordingly patch applied to cws impress202
changed target
sj: the bugfix looks good -> verified
closing integrated issue