[Libreoffice-commits] core.git: Branch 'libreoffice-3-6' - cppuhelper/source

Stephan Bergmann sbergman at redhat.com
Thu Jun 6 06:25:22 PDT 2013


 cppuhelper/source/defaultbootstrap.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 1e07c17c15e814393603bc2bc448ec7e7a57c341
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 6 10:10:21 2013 +0200

    rhbz#908819: Don't call code in UNO object ctor that throws UNO exceptions
    
    ...with Context set to this, that leads to refcounting bugs.  This is a backport
    of the relevant parts of 4e42ce3271154904b7478b9ed5e6e6856b9235c2 "Don't call
    code in UNO object ctor that throws UNO exceptions."
    
    Change-Id: Ie6fdf92fdf537b752cd05ed69c3b59f2c7795e28
    Reviewed-on: https://gerrit.libreoffice.org/4173
    Reviewed-by: Luboš Luňák <l.lunak at suse.cz>
    Tested-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index 7fd1e4a..e027564 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -590,13 +590,13 @@ class ServiceManager:
     private osl::Mutex, public ServiceManagerBase, private boost::noncopyable
 {
 public:
-    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)
     {
@@ -1996,7 +1996,8 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
     css::uno::Reference< css::registry::XSimpleRegistry > const & typeRegistry,
     rtl::OUString const & serviceUris, rtl::Bootstrap const & bootstrap)
 {
-    rtl::Reference< ServiceManager > smgr(new ServiceManager(serviceUris));
+    rtl::Reference< ServiceManager > smgr(new ServiceManager);
+    smgr->init(serviceUris);
     cppu::ContextEntry_Init entry;
     std::vector< cppu::ContextEntry_Init > context_values;
     context_values.push_back(


More information about the Libreoffice-commits mailing list