Files
zed/crates/gpui_macos
Lukas Wirth e2ecd3e85a gpui_macos: Fix stale atlas key causing crash on None texture lookup (#51996)
MetalAtlas::remove() used tiles_by_key.get(key) to look up the texture
ID but only called tiles_by_key.remove(key) when the texture became
fully unreferenced. When a tile was removed while other tiles remained
on the same texture, the key stayed in tiles_by_key as a stale entry.

Once subsequent removals deleted the texture, get_or_insert_with could
return the stale tile referencing a now-deleted texture slot, causing an
unwrap panic in MetalAtlasState::texture().

Fix: change .get(key) to .remove(key) unconditionally, matching the WGPU
and DirectX atlas implementations which already do this correctly.

Closes ZED-5KV

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-03-24 20:25:35 -06:00
..
2026-02-28 02:54:15 +00:00
2026-02-28 02:54:15 +00:00