rtl::Static->thread-safe static in unoxml
Change-Id: Icb458f9ba38225aef17a2421533be79c6d9445d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
4bc44490f5
commit
2fe77d0ed8
@@ -19,25 +19,21 @@
|
|||||||
|
|
||||||
#include "domimplementation.hxx"
|
#include "domimplementation.hxx"
|
||||||
|
|
||||||
#include <rtl/instance.hxx>
|
|
||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
|
#include <rtl/ref.hxx>
|
||||||
|
|
||||||
using namespace css::uno;
|
using namespace css::uno;
|
||||||
using namespace css::xml::dom;
|
using namespace css::xml::dom;
|
||||||
|
|
||||||
namespace DOM
|
namespace DOM
|
||||||
{
|
{
|
||||||
// why the heck is this thing static?
|
|
||||||
// perhaps it would be helpful to know what the implementation should
|
|
||||||
// do to answer this question...
|
|
||||||
namespace {
|
|
||||||
struct DOMImplementation
|
|
||||||
: public ::rtl::Static<CDOMImplementation, DOMImplementation> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
CDOMImplementation* CDOMImplementation::get()
|
CDOMImplementation* CDOMImplementation::get()
|
||||||
{
|
{
|
||||||
return & DOMImplementation::get();
|
// why the heck is this thing static?
|
||||||
|
// perhaps it would be helpful to know what the implementation should
|
||||||
|
// do to answer this question...
|
||||||
|
static rtl::Reference<CDOMImplementation> xDOMImplementation = new CDOMImplementation;
|
||||||
|
return &*xDOMImplementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
// there is just 1 static instance, so these must not delete it!
|
// there is just 1 static instance, so these must not delete it!
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <rtl/instance.hxx>
|
|
||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
#include <sal/log.hxx>
|
#include <sal/log.hxx>
|
||||||
|
Reference in New Issue
Block a user