Only joining threads if they are created

This commit is contained in:
Strahinja Val Markovic 2013-02-16 12:07:20 -08:00
parent 30d5a3b8a5
commit 2ff85a5a60
2 changed files with 8 additions and 4 deletions

View File

@ -101,8 +101,10 @@ ClangCompleter::~ClangCompleter() {
sorting_threads_.interrupt_all();
sorting_threads_.join_all();
clang_thread_->interrupt();
clang_thread_->join();
if ( clang_thread_ ) {
clang_thread_->interrupt();
clang_thread_->join();
}
}

View File

@ -103,8 +103,10 @@ IdentifierCompleter::~IdentifierCompleter() {
query_threads_.interrupt_all();
query_threads_.join_all();
buffer_identifiers_thread_->interrupt();
buffer_identifiers_thread_->join();
if ( buffer_identifiers_thread_ ) {
buffer_identifiers_thread_->interrupt();
buffer_identifiers_thread_->join();
}
}