From 6bc5d6cac2fd9e029357c618510a3b5f3aa7c085 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 28 Nov 2021 18:32:59 +0200 Subject: 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 --- salhelper/source/thread.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'salhelper') 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(); } -- cgit