Files
oak-gpui/crates
Thorsten BallandAntonio 9c54bd1bd4 macOS: Drop input handler to avoid editor/project not being dropped (#18898)
This fixes the problem of a `Project` sometimes not being dropped when
closing the single, last window of Zed.

Turns out, it wasn't get dropped for the following reason:

1. `editor::Editor` held a reference to project
2. The macOS `input_handler` on the `Window` held a reference to that
`Editor`
3. The AppKit window (and its input handler) get dropped asynchronously
(in the code in this diff), after the window is closed.
4. After the window is closed and no `cx.update()` calls are made
anymore, `flush_effects` is not called anymore.
5. But `flush_effects` is where we dropped entities that don't have any
more references.

In short: we dropped `Editor`, which held a reference to `Project`, out
of band, `flush_effects` wasn't called anymore, and thus the `Project`
wasn't dropped.

cc @ConradIrwin @bennetbo since we talked about this.

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2024-10-09 10:45:35 +02:00
..
2024-10-08 11:54:28 +02:00
2024-10-09 01:07:18 -07:00
2024-09-13 13:17:49 -04:00
2024-04-30 23:31:59 -06:00
2024-08-13 23:06:07 -07:00
2024-09-23 15:28:04 -06:00
2024-07-15 17:04:15 -06:00
2024-09-23 15:28:04 -06:00
2024-10-08 11:54:28 +02:00
2024-09-27 13:30:25 -04:00
2024-10-02 13:27:16 +02:00
2024-09-24 16:23:08 -06:00
2024-10-09 01:07:18 -07:00
2024-09-16 08:29:46 -04:00
2024-10-09 01:07:18 -07:00