From 01884ed880e5519bd9d37db882216a81dfafdf8b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 20 Jun 2016 17:06:58 +0100 Subject: Fix another case where an exception could be thrown from a destructor. --- src/lib/job.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/job.cc b/src/lib/job.cc index 75a5505a9..ba91debb7 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -62,8 +62,14 @@ Job::~Job () { if (_thread) { _thread->interrupt (); - DCPOMATIC_ASSERT (_thread->joinable ()); - _thread->join (); + /* We can't use DCPOMATIC_ASSERT here as it may throw an exception */ + if (_thread->joinable ()) { + try { + _thread->join (); + } catch (...) { + /* Too late to do anything about this */ + } + } } delete _thread; -- cgit v1.2.3