# Hold a weak handle to \`Presenter\` when dispatching events · gitcafe/zed

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

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

Visibility: public

Requested revision: e0c772db3e93d2ccd13c80e69ece4354cfd1dc7b

Requested commit: e0c772db3e93d2ccd13c80e69ece4354cfd1dc7b

Commit: e0c772db3e93d2ccd13c80e69ece4354cfd1dc7b

Tree: 64b708eb287b75623238dd4fdda6e943b24507f0

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Hold a weak handle to `Presenter` when dispatching events

This ensures that the only strong reference to the presenter is held
by `App`. This is important because we want to call `flush_effects`
when removing a window and implicit drops of the `Presenter` would
make that hard.

Before this commit, if a rendered view contained strong handles to
views and models, we would only drop them on the next `flush_effects`.
This was manifesting itself in `Project`s not being released when
closing their containing window.

```

## Parents

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

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