summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-05-08 12:29:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-05-08 12:29:53 +0200
commit4e42ce3271154904b7478b9ed5e6e6856b9235c2 (patch)
treecddb17b331904e0978032d189d33a04c725f83a4 /cppuhelper
parent56fa2d1bed5b19af79e31db9065f1a05e6202764 (diff)
Don't call code in UNO object ctor that throws UNO exceptions
...with Context set to this, that leads to refcounting bugs. Change-Id: I4875dbe4ccb5a7bcfaa8370b14d4eab83c21d0e5
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/defaultbootstrap.cxx9
-rw-r--r--cppuhelper/source/servicemanager.hxx6
-rw-r--r--cppuhelper/source/typemanager.cxx6
-rw-r--r--cppuhelper/source/typemanager.hxx4
4 files changed, 14 insertions, 11 deletions
diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index fc790bac1134..ff8338964132 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -56,11 +56,10 @@ cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri)
css::uno::Reference< css::uno::XInterface >());
}
rtl::Reference< cppuhelper::ServiceManager > smgr(
- new cppuhelper::ServiceManager(
- getBootstrapVariable(bs, "UNO_SERVICES")));
- rtl::Reference< cppuhelper::TypeManager > tmgr(
- new cppuhelper::TypeManager(
- getBootstrapVariable(bs, "UNO_TYPES")));
+ new cppuhelper::ServiceManager);
+ smgr->init(getBootstrapVariable(bs, "UNO_SERVICES"));
+ rtl::Reference< cppuhelper::TypeManager > tmgr(new cppuhelper::TypeManager);
+ tmgr->init(getBootstrapVariable(bs, "UNO_TYPES"));
cppu::ContextEntry_Init entry;
std::vector< cppu::ContextEntry_Init > context_values;
context_values.push_back(
diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx
index b57891e4b821..78359a2407d7 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -129,13 +129,13 @@ public:
ImplementationMap singletons;
};
- explicit ServiceManager(rtl::OUString const & rdbUris):
- ServiceManagerBase(*static_cast< osl::Mutex * >(this))
- { readRdbs(rdbUris); }
+ ServiceManager(): ServiceManagerBase(*static_cast< osl::Mutex * >(this)) {}
using ServiceManagerBase::acquire;
using ServiceManagerBase::release;
+ void init(rtl::OUString const & rdbUris) { readRdbs(rdbUris); }
+
void setContext(
css::uno::Reference< css::uno::XComponentContext > const & context)
{
diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx
index c4f4cbc714f4..6f7cd898d464 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1863,10 +1863,12 @@ void Enumeration::findNextMatch() {
}
-cppuhelper::TypeManager::TypeManager(rtl::OUString const & rdbUris):
+cppuhelper::TypeManager::TypeManager():
TypeManager_Base(*static_cast< osl::Mutex * >(this)),
manager_(new unoidl::Manager)
-{
+{}
+
+void cppuhelper::TypeManager::init(rtl::OUString const & rdbUris) {
readRdbs(rdbUris);
}
diff --git a/cppuhelper/source/typemanager.hxx b/cppuhelper/source/typemanager.hxx
index 5488aea2ed51..a1a2108409fe 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -51,11 +51,13 @@ TypeManager_Base;
class TypeManager: private osl::Mutex, public TypeManager_Base {
public:
- explicit TypeManager(rtl::OUString const & rdbUris);
+ TypeManager();
using TypeManager_Base::acquire;
using TypeManager_Base::release;
+ void init(rtl::OUString const & rdbUris);
+
css::uno::Any find(rtl::OUString const & name);
css::uno::Reference< css::reflection::XTypeDescription > resolve(