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,9 +101,11 @@ ClangCompleter::~ClangCompleter() {
sorting_threads_.interrupt_all();
sorting_threads_.join_all();
if ( clang_thread_ ) {
clang_thread_->interrupt();
clang_thread_->join();
}
}
// We need this mostly so that we can not use it in tests. Apparently the

View File

@ -103,9 +103,11 @@ IdentifierCompleter::~IdentifierCompleter() {
query_threads_.interrupt_all();
query_threads_.join_all();
if ( buffer_identifiers_thread_ ) {
buffer_identifiers_thread_->interrupt();
buffer_identifiers_thread_->join();
}
}
// We need this mostly so that we can not use it in tests. Apparently the