From eda78c4604c9b9c36f863ff60cd6b5684a177ac5 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 13 Apr 2020 19:14:05 +0200 Subject: [PATCH] Avoid use of `catch` in the destructor --- src/sfizz/FilePool.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/sfizz/FilePool.cpp b/src/sfizz/FilePool.cpp index a356dca2..140beaa0 100644 --- a/src/sfizz/FilePool.cpp +++ b/src/sfizz/FilePool.cpp @@ -106,12 +106,10 @@ sfz::FilePool::~FilePool() { quitThread = true; - for (unsigned i = 0; i < threadPool.size(); ++i) - try { - workerBarrier.post(); - } catch (std::exception& e) { - continue; - } + for (unsigned i = 0; i < threadPool.size(); ++i) { + std::error_code ec; + workerBarrier.post(ec); + } for (auto& thread: threadPool) thread.join();