From 47cdd3ba605324072db617c6ae2d1a647b8bdce6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Dec 2021 09:57:16 +0200 Subject: 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 --- salhelper/source/thread.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'salhelper') 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; } } -- cgit