# scheduler: Fix scheduler retention cycle \(\#57789\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f839f8e1083c113a2a2b308014bb42ac31cd7809

Requested commit: f839f8e1083c113a2a2b308014bb42ac31cd7809

Commit: f839f8e1083c113a2a2b308014bb42ac31cd7809

Tree: c32bfbf0ab188ef8b729a617f7d9111121bddfac

Author: Lukas Wirth

Committer: GitHub

## Message

```
scheduler: Fix scheduler retention cycle (#57789)

async_tasks can build a cycle with the scheduler where the runnable
itself keeps a reference to the scheduler and the scheduler keeping
references to the runnable. This effectively can cause scheduler / task
leaks, most notably in test environments, so we break this cycle by
using weak pointers instead.

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

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

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