diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 2a03896502a9..41d7c253d534 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -43,13 +43,18 @@ #include "attr.hxx" #include - +#include "rtl/instance.hxx" +#include "osl/mutex.hxx" #include "../events/eventdispatcher.hxx" #include "../events/mutationevent.hxx" #include #include +namespace { + struct NodeMutex: public ::rtl::Static {}; +} + namespace DOM { void pushContext(Context& io_rContext) @@ -131,6 +136,7 @@ namespace DOM void CNode::remove(const xmlNodePtr aNode) { + ::osl::MutexGuard guard(NodeMutex::get()); nodemap_t::iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end()) { @@ -145,7 +151,7 @@ namespace DOM CNode* pNode = 0; if (aNode == NULL) return 0; - + ::osl::MutexGuard guard(NodeMutex::get()); //check whether there is already an instance for this node nodemap_t::const_iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end())