summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyuno/source/loader/pyuno_loader.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index 0db1b9b59023..718edc744b46 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -223,6 +223,10 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c
PyThreadState *tstate = PyThreadState_Get();
PyEval_ReleaseThread( tstate );
+ // This tstate is never used again, so delete it here.
+ // This prevents an assertion in PyThreadState_Swap on the
+ // PyThreadAttach below.
+ PyThreadState_Delete(tstate);
}
PyThreadAttach attach( PyInterpreterState_Head() );