summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyuno/source/module/pyuno_gc.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index e4ed6cb9d0a6..1efca400d510 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -111,11 +111,20 @@ void decreaseRefCount( PyInterpreterState *interpreter, PyObject *object )
// to be a method, which tells, whether the global
// interpreter lock is held or not
// TODO: Look for a more efficient solution
- rtl::Reference< GCThread >(new GCThread(interpreter, object))->launch();
+ try
+ {
+ rtl::Reference< GCThread >(new GCThread(interpreter, object))->launch();
//TODO: a protocol is missing how to join with the launched thread
// before exit(3), to ensure the thread is no longer relying on any
// infrastructure while that infrastructure is being shut down in
// atexit handlers
+ }
+ catch (std::runtime_error&)
+ {
+ // tdf#146621: Thread creation will fail on Windows with ERROR_ACCESS_DENIED
+ // when called at ExitProcess time; unhandled exception would hang the process
+ abort();
+ }
}
}