summaryrefslogtreecommitdiff
path: root/pyuno/source/loader/pyuno_loader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'pyuno/source/loader/pyuno_loader.cxx')
-rw-r--r--pyuno/source/loader/pyuno_loader.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index db6acb04dbd8..a92a538161b1 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -172,9 +172,7 @@ static void prependPythonPath( const OUString & pythonPathBootstrap )
namespace {
-struct PythonInit
-{
-PythonInit() {
+void pythonInit() {
if ( Py_IsInitialized()) // may be inited by getComponentContext() already
return;
@@ -228,7 +226,6 @@ PythonInit() {
// PyThreadAttach below.
PyThreadState_Delete(tstate);
}
-};
}
@@ -236,8 +233,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
pyuno_Loader_get_implementation(
css::uno::XComponentContext* ctx , css::uno::Sequence<css::uno::Any> const&)
{
- // tdf#114815 thread-safe static to init python only once
- static PythonInit s_Init;
+ // tdf#114815 init python only once, via single-instace="true" in pythonloader.component
+ pythonInit();
Reference< XInterface > ret;