From 394d6284eb16381ca9f0731a3c156acc6b1a2735 Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 18 Jun 2015 13:48:10 +0200 Subject: [PATCH] join the parse_thread only if its joinable (created in this case). --- juci/source.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/juci/source.cc b/juci/source.cc index 1c3d0df..a57da0f 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -276,7 +276,8 @@ Source::Controller::~Controller() { parse_thread_stop=true; parsing.lock(); //Be sure not to destroy while still parsing with libclang parsing.unlock(); - parse_thread.join(); + if(parse_thread.joinable()) + parse_thread.join(); } void Source::Controller::OnNewEmptyFile() {