# Fix projects leaking via agents panel \(\#63765\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5313741ffaa73955ccf5b7cb2c8e15e61d9f92d3

Requested commit: 5313741ffaa73955ccf5b7cb2c8e15e61d9f92d3

Commit: 5313741ffaa73955ccf5b7cb2c8e15e61d9f92d3

Tree: 3e5118fa85a6d3a6482e02dd16c64c68e744fce7

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Fix projects leaking via agents panel (#63765)

When working with multiple windows, one agent worked in the external
hard drive's directory.
After finishing working on that external dir, I've closed the entire
window (the other one, unrelated, remained) only to discover I cannot
unmount the external hard drive.

Investigated, and seems that that manual `ref_count` is buggy — replaced
that with `WeakEntry` for both agent and ACP parts.
Also added leaked project logging into reliability.

Release Notes:

- Fixed projects leaking via agents panel
```

## Parents

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

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