# Stop extensions' servers and message loops before removing their files \(\#34208\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c6603e4fba9c917f354c1ce40c1f6eb1d1818971

Requested commit: c6603e4fba9c917f354c1ce40c1f6eb1d1818971

Commit: c6603e4fba9c917f354c1ce40c1f6eb1d1818971

Tree: ce00cee008448e24fd7d2f0533a4fd3c18d5d487

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Stop extensions' servers and message loops before removing their files (#34208)

Fixes an issue that caused Windows to fail when removing extension's
directories, as Zed had never stop any related processes.

Now:

* Zed shuts down and waits until the end when the language servers are
shut down

* Adds `impl Drop for WasmExtension` where does
`self.tx.close_channel();` to stop a receiver loop that holds the "lock"
on the extension's work dir.
The extension was dropped, but the channel was not closed for some
reason.

* Does more unregistration to ensure `Arc<WasmExtension>` with the `tx`
does not leak further

* Tidies up the related errors which had never reported a problematic
path before

Release Notes:

- N/A

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Smit <smit@zed.dev>
```

## Parents

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

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