diff options
author | Noel Grandin <noel@peralex.com> | 2021-12-01 09:57:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-01 13:04:17 +0100 |
commit | 47cdd3ba605324072db617c6ae2d1a647b8bdce6 (patch) | |
tree | d7e3e6b6ab64e30bcd5a662efe668417a18f796d /salhelper/source | |
parent | 90243614b253bc2d6b3d12930f111eab5491316a (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.cxx | 9 |
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; } } |