kit/Kit.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 4641c922eac1c5f5d2ed2adefd8119011e7fdab5 Author: Henry Castro <hcas...@collabora.com> Date: Fri Jan 6 15:49:33 2017 -0400 kit: use a second stage init after fork call diff --git a/kit/Kit.cpp b/kit/Kit.cpp index 62a183a..bfe75de 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -95,6 +95,7 @@ using namespace LOOLProtocol; // We only host a single document in our lifetime. class Document; static std::shared_ptr<Document> document; +static LokHookFunction2* pInit = nullptr; namespace { @@ -1594,7 +1595,7 @@ void lokit_main(const std::string& childRoot, auto kit = UnitKit::get().lok_init(instdir, userdir); if (!kit) { - kit = lok_init_2(instdir, userdir); + kit = (pInit ? pInit(instdir, userdir) : lok_init_2(instdir, userdir)); } loKit = std::make_shared<lok::Office>(kit); @@ -1792,6 +1793,12 @@ bool globalPreinit(const std::string &loTemplate) return false; } + pInit = reinterpret_cast<LokHookFunction2 *>(dlsym(handle, "libreofficekit_hook_2")); + if (!pInit) + { + LOG_FTL("No libreofficekit_hook_2 symbol in " << loadedLibrary << ": " << dlerror()); + } + LOG_TRC("lok_preinit(" << loTemplate << "/program\", \"file:///user\")"); if (preInit((loTemplate + "/program").c_str(), "file:///user") != 0) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits