diff --git a/cpp/ycm/ClangCompleter/ClangCompleter.cpp b/cpp/ycm/ClangCompleter/ClangCompleter.cpp index b50801c6..d1fda853 100644 --- a/cpp/ycm/ClangCompleter/ClangCompleter.cpp +++ b/cpp/ycm/ClangCompleter/ClangCompleter.cpp @@ -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(); + } } diff --git a/cpp/ycm/IdentifierCompleter.cpp b/cpp/ycm/IdentifierCompleter.cpp index ec7c62e3..8f3b2c21 100644 --- a/cpp/ycm/IdentifierCompleter.cpp +++ b/cpp/ycm/IdentifierCompleter.cpp @@ -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(); + } }