Issue 112783 - unoxml: ownership cycles in unoxml
Summary: unoxml: ownership cycles in unoxml
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: DEV300m83
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: 3.4.0
Assignee: caolanm
QA Contact: issues@framework
URL:
Keywords:
: 113601 (view as issue list)
Depends on:
Blocks: 112782
  Show dependency tree
 
Reported: 2010-06-29 13:18 UTC by caolanm
Modified: 2017-05-20 10:22 UTC (History)
3 users (show)

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


Attachments
like so (3.33 KB, patch)
2010-06-29 13:20 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2010-06-29 13:18:53 UTC
In unoxml when a uno xml element is created, e.g. 

xDoc->getDocumentElement() in 
desktop/source/deployment/registry/package/dp_description.cxx

Each such UNO xml node is implemented with a CNode
every CNode takes a uno::Reference to its owner document for the nodes lifecycle
i.e. m_rDocument = getOwnerDocument() in unoxml/source/dom/node.cxx

but each CNode also calls "addnode" on its owner to add a uno::Reference to that
node from the ownerdocument for its lifecycle

Each node holds a reference to the ownerdocument, and the ownerdocument holds a
reference to each node which means that the whole cycle doesn't get released.

In this case I think it should be sufficient for each child node to hold a
reference to the parent document.
Comment 1 caolanm 2010-06-29 13:20:13 UTC
Created attachment 70288 [details]
like so
Comment 2 Mathias_Bauer 2010-06-29 15:05:09 UTC
Michael, please have a look
Comment 3 mst.ooo 2010-08-04 11:25:09 UTC
*** Issue 113601 has been marked as a duplicate of this issue. ***
Comment 4 mst.ooo 2010-08-04 17:04:53 UTC
thanks for getting rid of this nonsense, i've committed the patch.

fixed in cws sw34bf01
http://hg.services.openoffice.org/hg/cws/sw34bf01/rev/7a0c765bdb60
http://hg.services.openoffice.org/hg/cws/sw34bf01/rev/d2ae78ad0a64
Comment 5 mst.ooo 2010-10-07 11:04:08 UTC
please verify
Comment 6 caolanm 2010-10-07 11:39:23 UTC
verified