desktop/source/app/appinit.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 96f3aeaa70d91b26861ac28f0b077b46546d3676 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Fri Aug 23 17:49:39 2024 +0200 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Fri Aug 23 22:06:38 2024 +0200 Emscripten: Only resolve Module.uno_init after Module.uno_mainPort is set Otherwise, client code (which is run as soon as Module.uno_init is resolved) could try to use Module.uno_mainPort before it has been set. Change-Id: Ibac992d965f43e9f6766d06e3bd80f1964258b19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172326 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 1dc962e7a008..3a8bce551d6a 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -86,6 +86,7 @@ EM_JS(void, setupMainChannel, (), { if (e.data.cmd === "LOWA-channel") { self.onmessage = orig; Module.uno_mainPort = e.ports[0]; + Module.uno_init$resolve(); } else if (orig) { orig(e); } @@ -119,7 +120,6 @@ void initUno() { runUnoScriptUrl(url.getStr()); } setupMainChannel(); - EM_ASM(Module.uno_init$resolve();); emscripten_async_run_in_main_runtime_thread(EM_FUNC_SIG_V, resolveUnoMain); }