summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-05-09 18:24:18 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-05-10 16:19:34 +0200
commite655dc8bbf010e5ef89c32c2ebde56281b323925 (patch)
tree177b6a6e6143448098ae84703e0c6996ac709e76 /desktop
parent9a78a4a16ff7b9a9d8f22809c5127f6389ec4805 (diff)
unipoll: let InitVCL tolerate double init.
We need to get VCL initialized early in UniPoll mode, since the main setup doesn't occur until runPoll is invoked, and we want to call lots of virtual methods that take the SolarMutex before then - which requires VCL to be initialized. Change-Id: Id9c1b74c126cf7bb71d6560b7585d37327a9f5ef Reviewed-on: https://gerrit.libreoffice.org/72071 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx27
1 files changed, 9 insertions, 18 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 339bda480f5f..7b46ee397904 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4885,24 +4885,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
force_c_locale();
}
- // We could use InitVCL() here -- and used to before using soffice_main,
- // however that now deals with the initialisation for us (and it's not
- // possible to try to set up VCL twice.
-
- // Instead VCL init is done for us by soffice_main in a separate thread,
- // however we specifically can't proceed until this setup is complete
- // (or you get segfaults trying to use VCL and/or deadlocks due to other
- // setup within soffice_main). Specifically the various Application::
- // functions depend on VCL being ready -- the deadlocks would happen
- // if you try to use loadDocument too early.
-
- // The RequestHandler is specifically set to be ready when all the other
- // init in Desktop::Main (run from soffice_main) is done. We can enable
- // the RequestHandler here (without starting any IPC thread;
- // shortcutting the invocation in Desktop::Main that would start the IPC
- // thread), and can then use it to wait until we're definitely ready to
- // continue.
-
if (eStage != PRE_INIT)
{
SAL_INFO("lok", "Re-initialize temp paths");
@@ -4912,6 +4894,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
aOptions.SetTempPath(aNewTemp);
desktop::Desktop::CreateTemporaryDirectory();
+ // The RequestHandler is specifically set to be ready when all the other
+ // init in Desktop::Main (run from soffice_main) is done. We can enable
+ // the RequestHandler here (without starting any IPC thread;
+ // shortcutting the invocation in Desktop::Main that would start the IPC
+ // thread), and can then use it to wait until we're definitely ready to
+ // continue.
+
SAL_INFO("lok", "Enabling RequestHandler");
RequestHandler::Enable(false);
SAL_INFO("lok", "Starting soffice_main");
@@ -4924,6 +4913,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
RequestHandler::WaitForReady();
SAL_INFO("lok", "RequestHandler ready -- continuing");
}
+ else
+ InitVCL();
}
if (eStage != SECOND_INIT)