34class StaticDestructorGuard
37 ~StaticDestructorGuard()
45static StaticDestructorGuard
guard;
57 GCThread( PyInterpreterState *interpreter, PyObject *
object );
60 virtual ~GCThread()
override {}
62 virtual void execute()
override;
70GCThread::GCThread( PyInterpreterState *interpreter, PyObject *
object ) :
71 Thread(
"pyunoGCThread" ),
mPyObject( object ),
75void GCThread::execute()
87 PyRef2Adapter::iterator ii =
88 runtime.getImpl()->cargo->mappedObjects.find(
mPyObject );
89 if( ii != runtime.getImpl()->cargo->mappedObjects.end() )
91 runtime.getImpl()->cargo->mappedObjects.erase( ii );
97 catch(
const css::uno::RuntimeException & e )
100 fprintf( stderr,
"Leaking python objects bridged to UNO for reason %s\n",msg.getStr());
122 catch (std::runtime_error&)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static bool g_destructorsOfStaticObjectsHaveBeenCalled
void decreaseRefCount(PyInterpreterState *interpreter, PyObject *object)
releases a refcount on the interpreter object and on another given python object.
static StaticDestructorGuard guard
static bool isAfterUnloadOrPy_Finalize()
PyInterpreterState * mPyInterpreter