pyuno_loader::CreateInstance: delete the initial PyThreadState

Don't see how it could be used again, it appears to be leaked
and causes the assertion in PyThreadState_Swap to fire.

Change-Id: Id6bbb4363928e4fdd8bda1905f6e1f9931dba74c
Reviewed-on: https://gerrit.libreoffice.org/3452
Reviewed-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Tested-by: David Ostrovsky <David.Ostrovsky@gmx.de>
This commit is contained in:
Michael Stahl
2013-04-18 12:38:42 +02:00
committed by David Ostrovsky
parent b7d21a8015
commit 1fb53a6375

View File

@@ -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() );