summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-02-10 17:27:42 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-25 18:30:03 +0200
commit27b208c5f945b06d308fede54523f77dbea5445b (patch)
tree1819603106c66c27d6257387f01a4309bca735bc /cppuhelper
parentb871f33f85422640ec9a248c80935f18e4eadb57 (diff)
lok: allow libraries to pre-init themselves.
Populate static module references before entering a jail containing no code. Implement for scfilt, scui, swui, sdui. Change-Id: I8fec2aa78e67053a7945926c818122bd4290103c Reviewed-on: https://gerrit.libreoffice.org/49545 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit f215096c24429fe69e7e5ab37898d0f0beeff0ab)
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/servicemanager.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 556440dc8733..b7f8b04557f4 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1974,6 +1974,19 @@ void cppuhelper::ServiceManager::preloadImplementations() {
iterator->second->status = Data::Implementation::STATUS_LOADED;
}
+
+ // Some libraries use other (non-UNO) libraries requiring preinit
+ oslGenericFunction fpPreload = aModule.getFunctionSymbol( "lok_preload_hook" );
+ if (fpPreload)
+ {
+ static std::vector<oslGenericFunction> aPreloaded;
+ if (std::find(aPreloaded.begin(), aPreloaded.end(), fpPreload) == aPreloaded.end())
+ {
+ aPreloaded.push_back(fpPreload);
+ fpPreload();
+ }
+ }
+
// leak aModule
aModule.release();
}