summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-04 10:06:17 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-16 07:59:37 +0000
commit4b73386f06f9cea4a23f7e0a0882540e3dd4aa0a (patch)
treea264ae7025c01230dd55744e2e84c0d7ee0d01b3 /toolkit
parent4e3d54fc9542af87d718b24bcd76a0529133f45f (diff)
Resolves: tdf#46440 SIGSEGV on toolkit bootstrap without running instance
(cherry picked from commit 3f69547397e5841d0915921be5be8b3edfdfdbc5) Change-Id: I9a78a75b3d72586b1702ed6fa63bb0b62ce6cd72 Reviewed-on: https://gerrit.libreoffice.org/16078 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 680fc0caa04b..4cc587308dfc 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/awt/XToolkitExperimental.hpp>
#include <com/sun/star/awt/XMessageBoxFactory.hpp>
+#include <cppuhelper/bootstrap.hxx>
#include <cppuhelper/compbase2.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -601,7 +602,26 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
{
osl_setThreadName("VCLXToolkit VCL main thread");
- VCLXToolkit * pTk = (VCLXToolkit *)pArgs;
+ css::uno::Reference<css::lang::XMultiServiceFactory> xServiceManager;
+ try
+ {
+ xServiceManager = ::comphelper::getProcessServiceFactory();
+ }
+ catch (const css::uno::DeploymentException&)
+ {
+ }
+ if (!xServiceManager.is())
+ {
+ css::uno::Reference<css::uno::XComponentContext> xContext =
+ ::cppu::defaultBootstrap_InitialComponentContext();
+
+ xServiceManager = css::uno::Reference<css::lang::XMultiServiceFactory>(
+ xContext->getServiceManager(), css::uno::UNO_QUERY_THROW );
+ // set global process service factory used by unotools config helpers
+ ::comphelper::setProcessServiceFactory( xServiceManager );
+ }
+
+ VCLXToolkit * pTk = static_cast<VCLXToolkit *>(pArgs);
bInitedByVCLToolkit = InitVCL();
if( bInitedByVCLToolkit )
{