[clangd] Fix crash if pending computations were active on exit
authorIlya Biryukov <ibiryukov@google.com>
Wed, 26 Sep 2018 05:48:29 +0000 (05:48 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 26 Sep 2018 05:48:29 +0000 (05:48 +0000)
commit652364b765cdd8a84e4e78f904d0b0049ca33960
treee73de07073ab2ae5b053f6f85bf809a0aae29eb5
parent4f98470deac92aeb7eb6e9cf208bd0b87c99b30d
[clangd] Fix crash if pending computations were active on exit

Summary:
Make sure JSONRPCDispatcher outlives the worker threads, they access
its fields to remove the stored cancellations when Context dies.

Reviewers: sammccall, ioeric

Reviewed By: ioeric

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D52420

llvm-svn: 343067
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdLSPServer.h