cppuhelper/source/defaultbootstrap.cxx |    9 ++++-----
 cppuhelper/source/servicemanager.hxx   |    6 +++---
 cppuhelper/source/typemanager.cxx      |    6 ++++--
 cppuhelper/source/typemanager.hxx      |    4 +++-
 4 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 4e42ce3271154904b7478b9ed5e6e6856b9235c2
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Wed May 8 12:29:53 2013 +0200

    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

diff --git a/cppuhelper/source/defaultbootstrap.cxx 
b/cppuhelper/source/defaultbootstrap.cxx
index fc790ba..ff833896 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 b57891e..78359a2 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 c4f4cbc..6f7cd89 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 5488aea..a1a2108 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(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to