Issue 120735 - Loading a document contains textfield objects, the para objects and editengine objects attached to it are not freed
Summary: Loading a document contains textfield objects, the para objects and editengin...
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: zhang jianfang
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 120975
  Show dependency tree
 
Reported: 2012-08-28 07:14 UTC by zhang jianfang
Modified: 2017-05-20 10:31 UTC (History)
0 users

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


Attachments
Sample odt file to show the memory leak (37.92 KB, application/vnd.oasis.opendocument.text)
2012-08-28 07:14 UTC, zhang jianfang
no flags Details
fix code patch (348 bytes, patch)
2012-08-28 07:25 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-28 07:14:07 UTC
Created attachment 79189 [details]
Sample odt file to show the memory leak

The the attached sample files, you may observe the OutlinerParaObject objects created by below call stack are never freed.

 	svxmi.dll!Outliner::CreateParaObject(unsigned short nStartPara=0x0000, unsigned short nCount=0x0001)  Line 448 + 0x18	C++
 	swmi.dll!SwTextAPIEditSource::CreateText()  Line 183 + 0x16	C++
>	swmi.dll!SwXTextField::attachToRange(const com::sun::star::uno::Reference<com::sun::star::text::XTextRange> & xTextRange={...})  Line 1342 + 0x1d	C++

And the object is set to SwPostItField object with this piece of code in api SwXTextField::attachToRange() (file writ\sw\source\core\unocore\unofield.cxx),

   ((SwPostItField*)pFld)->SetTextObject( m_pTextObject->CreateText() );
Comment 1 zhang jianfang 2012-08-28 07:25:21 UTC
Created attachment 79191 [details]
fix code patch

The created object is only referred in SwPostItField.mpText. Need to delete it in SwPostItField dtor api.
Comment 2 SVN Robot 2012-09-04 05:20:20 UTC
"zhangjf" committed SVN revision 1380452 into trunk:
#i120735#, the para object or editengine object attached to textfield object ...
Comment 3 zhang jianfang 2012-09-04 05:21:01 UTC
Change to resolved state.