summaryrefslogtreecommitdiff
path: root/pyuno/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-01-07 11:21:31 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-01-07 14:30:30 +0100
commit639419601a3730eb84d0922ef3a540c961b81910 (patch)
tree938414d06cf3e8a140a2b2480659f093ec4e34c6 /pyuno/source
parent8295a3344704ce9a18489933c499a50c403f1a3d (diff)
tdf#146621: handle an exception that may hang process at ExitProcess time
Change-Id: I3ffc2303ae1851ab909612ae9bb7f70a077b24fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128097 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'pyuno/source')
-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();
+ }
}
}