projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
511f4bb
)
assert (joinable) before joining threads; fix possible crash after cancelling jobs.
author
Carl Hetherington
<cth@carlh.net>
Thu, 24 Sep 2015 15:03:06 +0000
(16:03 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 24 Sep 2015 15:03:06 +0000
(16:03 +0100)
src/lib/job.cc
patch
|
blob
|
history
diff --git
a/src/lib/job.cc
b/src/lib/job.cc
index 439000e5876dcc61b061c8ddbfdf6645be026905..7aaac748c115a1d9e65144027e7eacf96f1d6640 100644
(file)
--- 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