To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=113663
                 Issue #|113663
                 Summary|unoxml: The libxml dom nodes of any removed UNOXML chi
                        |ld nodes are not freed
               Component|framework
                 Version|OOO320m11
                Platform|All
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|PATCH
                Priority|P3
            Subcomponent|code
             Assigned to|mba
             Reported by|zhangjfibm





------- Additional comments from zhangjf...@openoffice.org Thu Aug  5 01:24:36 
+0000 2010 -------
The problem is not so serious with normal usages, but it's solution may related
with http://www.openoffice.org/issues/show_bug.cgi?id=112783. Please also take a
look.

To repeat the problem, just simply open any odf document, then save and close
it.  When saving the odf document, to update some ODF meta data,
DOM::CElement::removeChild() is called, so several unoxml dom CNode are removed
from the dom tree. Below is the callstack when it happens,

        unoxmlmi.dll!DOM::CNode::removeChild(const
com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> &
oldChild={...})  Line 715       C++
        unoxmlmi.dll!DOM::CElement::removeChild(const
com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> &
oldChild={...})  Line 274 + 0x11        C++
>       sfxmi.dll!`anonymous namespace'::SfxDocumentMetaData::setMetaList(const 
> char *
i_name=0x01ba5154, const com::sun::star::uno::Sequence<rtl::OUString> &
i_rValue={...}, const _STL::vector<_STL::vector<_STL::pair<char const
*,rtl::OUString>,_STL::allocator<_STL::pair<char const *,rtl::OUString> >
>,_STL::allocator<_STL::vector<_STL::pair<char const
*,rtl::OUString>,_STL::allocator<_STL::pair<char const *,rtl::OUString> > > > >
* i_pAttrs=0x0185b6fc)  Line 875 + 0x41 C++
        sfxmi.dll!`anonymous
namespace'::SfxDocumentMetaData::updateUserDefinedAndAttributes()  Line 1056 +
0x16    C++
        sfxmi.dll!`anonymous namespace'::SfxDocumentMetaData::serialize(const
com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> &
i_xHandler={...}, const
com::sun::star::uno::Sequence<com::sun::star::beans::StringPair> &
i_rNamespaces={...})  Line 2311 + 0xc   C++
        xomi.dll!SvXMLMetaExport::Export()  Line 376 + 0x8e     C++



For any UNO XML CNode objects that are not removed from the DOM tree, their
corresponding libxml DOM nodes will be completely removed by api
xmlFreeDoc(m_aDocPtr) in CDocument::~CDocument(),

CDocument::~CDocument(){
...
xmlFreeDoc(m_aDocPtr);
}

But for any removed Childern CNodes, libxml dom tree doesn't have all these
nodes, so in fact all these node will leak after the CDocument object released.

DOM::CElement::removeChild() may be also called in other cases, such as calling
through UNO API  :: com :: sun :: star :: xml :: dom :: XNode::removeChild()
directly in OOo applications.

Our current ugly fix is to identify all removed Child CNode objects in CDocument
dtor api, then for each orphaned CNode, call xmlFreeNodeList().  But it seems
this fix conflicts with the fix code of
http://www.openoffice.org/issues/show_bug.cgi?id=112783, since CDocument won't
remember all child CNode objects any more.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org
For additional commands, e-mail: issues-h...@framework.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to