# Fix entity map drop behavior · gitcafe/zed

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

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

Visibility: public

Requested revision: 3e5379526ebdfbc769a83cef60f53d406bbdcbb4

Requested commit: 3e5379526ebdfbc769a83cef60f53d406bbdcbb4

Commit: 3e5379526ebdfbc769a83cef60f53d406bbdcbb4

Tree: 86e9240867543cf3003b2be64fe3fdc695b3ebe1

Author: Conrad Irwin

Committer: Conrad Irwin

## Message

```
Fix entity map drop behavior

The entity map needs to be able to distinguish between the case when
the entity_id is waiting to be dropped, and when it is completely gone.

Before 8bc207141, it assumed that entity_ids in dropped_entity_ids could
be re-used. This caused `take_dropped` to error because the slot had
been overwritten. The fix there caused weak handles to allow upgrading
a reference count from 0, which could resurrect items in
`dropped_entity_ids` which caused them to be dropped twice.

We could allow weak items to upgrade from 0, and delete from
dropped_entity_ids, but that seemed more complicated than necessary.

```

## Parents

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

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