summaryrefslogtreecommitdiff
path: root/salhelper
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-11-28 18:32:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-29 09:58:43 +0100
commit6bc5d6cac2fd9e029357c618510a3b5f3aa7c085 (patch)
tree9ef016fe86e3e4554ccca9893f8d7c4228c5f395 /salhelper
parent53f90ba47376aac928c6666d34ef62473052bf6d (diff)
remove counter-productive catch-all blocks
There is no point in these - the rethrow will crash the process anyway, so trying to recover anything is a waste of time. And they very unhelpfully obscure the stacktrace of the actual underlying problem. Change-Id: I8e4439e5e2c517aa80a1750a05c207d274c73012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125980 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'salhelper')
-rw-r--r--salhelper/source/thread.cxx20
1 files changed, 4 insertions, 16 deletions
diff --git a/salhelper/source/thread.cxx b/salhelper/source/thread.cxx
index 1a06bf3b235a..3d9c4b372005 100644
--- a/salhelper/source/thread.cxx
+++ b/salhelper/source/thread.cxx
@@ -22,28 +22,16 @@ 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();
- try {
- if (!create()) {
- throw std::runtime_error("osl::Thread::create failed");
- }
- } catch (...) {
- release();
- throw;
+ if (!create()) {
+ throw std::runtime_error("osl::Thread::create failed");
}
}
salhelper::Thread::~Thread() {}
void salhelper::Thread::run() {
- try {
- setName(name_);
- execute();
- } catch (...) {
- // Work around the problem that onTerminated is not called if run throws
- // an exception:
- onTerminated();
- throw;
- }
+ setName(name_);
+ execute();
}
void salhelper::Thread::onTerminated() { release(); }