# Fix race conditions with LSP requests that return buffers · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/170487a5283b3d7783aa24e5485c0974600165e3)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 170487a5283b3d7783aa24e5485c0974600165e3

Requested commit: 170487a5283b3d7783aa24e5485c0974600165e3

Commit: 170487a5283b3d7783aa24e5485c0974600165e3

Tree: c3ea3c857af51bdfa40537df3747949c8f4d774e

Author: Max Brunsfeld

Committer: Max Brunsfeld

## Message

```
Fix race conditions with LSP requests that return buffers

* Avoid panic when registering a buffer that was previously open,
  and whose weak handle was still present in the open_buffers map.
* Avoid releasing any buffers while a request is outstanding which
  could return a reference to a buffer.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

```

## Parents

- [17c9aa181936b55f2953e5c44b9a375a027f6838](https://git.cafe/gitcafe/zed/commit/17c9aa181936b55f2953e5c44b9a375a027f6838?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/170487a5283b3d7783aa24e5485c0974600165e3?format=markdown)
