jl157 #161910# make access to static map in unoxml threadsafe
This commit is contained in:
parent
ed873a73fd
commit
1c5011a89f
1 changed files with 8 additions and 2 deletions
|
@ -43,13 +43,18 @@
|
|||
#include "attr.hxx"
|
||||
|
||||
#include <com/sun/star/xml/sax/FastToken.hpp>
|
||||
|
||||
#include "rtl/instance.hxx"
|
||||
#include "osl/mutex.hxx"
|
||||
#include "../events/eventdispatcher.hxx"
|
||||
#include "../events/mutationevent.hxx"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace {
|
||||
struct NodeMutex: public ::rtl::Static<osl::Mutex, NodeMutex> {};
|
||||
}
|
||||
|
||||
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())
|
||||
|
|
Loading…
Reference in a new issue