summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-24 16:03:06 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-24 16:03:06 +0100
commitb7ef3e79b9eb4f245556e69c68ee624c5b43e126 (patch)
tree4236c2175d5bfe6c70d4318e0329c98c448d091b /src/lib
parent511f4bbb6dd088cc32163edfe5004761a33a8311 (diff)
assert (joinable) before joining threads; fix possible crash after cancelling jobs.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/job.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 439000e58..7aaac748c 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -59,6 +59,7 @@ Job::~Job ()
{
if (_thread) {
_thread->interrupt ();
+ DCPOMATIC_ASSERT (_thread->joinable ());
_thread->join ();
}
@@ -416,7 +417,10 @@ Job::cancel ()
}
_thread->interrupt ();
+ DCPOMATIC_ASSERT (_thread->joinable ());
_thread->join ();
+ delete _thread;
+ _thread = 0;
}
void