Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | forms: When opening a form document, it expose obvious memory leak after it is closed | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | General | Reporter: | zhang jianfang <zhangjf> | ||||||
Component: | code | Assignee: | zhang jianfang <zhangjf> | ||||||
Status: | CLOSED FIXED | QA Contact: | issues@tools <issues> | ||||||
Severity: | Trivial | ||||||||
Priority: | P2 | CC: | issues, zhangjf | ||||||
Version: | 3.4.1 | ||||||||
Target Milestone: | 4.0.0 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||
Developer Difficulty: | --- | ||||||||
Issue Depends on: | |||||||||
Issue Blocks: | 120975, 121366 | ||||||||
Attachments: |
|
Description
zhang jianfang
2010-08-03 09:07:32 UTC
Created attachment 70928 [details]
form document
@mba: whose code is xmloff these days ? There is no single xmloff maintainer. So as forms are concerned, let's start with fs. Created attachment 79380 [details]
fix code patch
When loading a doc with forms, in XFormsModelContext::XFormsModelContext(), it creates a xforms::Model object, then in XFormsModelContext::HandleChild(), the created xforms::Model object is used to create XFormsBindContext and XFormsSubmissionContext objects. In their ctor apis, several binding and submission objects are created with api mxModel->createxxxx(), and put into XFormsModelContext bindings and submissions xset object. The memory leak is caused by cyclic reference between XFormsModelContext and binding/submission objects. To break the cyclic reference, in SwDoc dtor api, all binding/submission objects in XFormsModelContext xset collection object should be released at first. So the fix is to create a new method SwDoc::disposeXForms() to break the cyclic reference.
"zhangjf" committed SVN revision 1384759 into trunk: #i113606#, in SwDoc dtor to release the cyclic reference between XFormModel a... change to resolved state |