summaryrefslogtreecommitdiff
path: root/salhelper/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-12-01 09:57:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-01 13:04:17 +0100
commit47cdd3ba605324072db617c6ae2d1a647b8bdce6 (patch)
treed7e3e6b6ab64e30bcd5a662efe668417a18f796d /salhelper/source
parent90243614b253bc2d6b3d12930f111eab5491316a (diff)
revert part of "remove counter-productive catch-all blocks"
as sberg points out, this rethrow will not necessarily crash the process Change-Id: I0ced6c102d1c0c1bf680b0903fcb232cc891bf92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126167 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'salhelper/source')
-rw-r--r--salhelper/source/thread.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/salhelper/source/thread.cxx b/salhelper/source/thread.cxx
index 3d9c4b372005..190daf5081b6 100644
--- a/salhelper/source/thread.cxx
+++ b/salhelper/source/thread.cxx
@@ -22,8 +22,13 @@ void salhelper::Thread::launch() {
// Assumption is that osl::Thread::create returns normally with a true
// return value iff it causes osl::Thread::run to start executing:
acquire();
- if (!create()) {
- throw std::runtime_error("osl::Thread::create failed");
+ try {
+ if (!create()) {
+ throw std::runtime_error("osl::Thread::create failed");
+ }
+ } catch (...) {
+ release();
+ throw;
}
}