diff --git a/documentation/NEXT_RELEASENOTES.txt b/documentation/NEXT_RELEASENOTES.txt index e69de29b..e45bbe5a 100644 --- a/documentation/NEXT_RELEASENOTES.txt +++ b/documentation/NEXT_RELEASENOTES.txt @@ -0,0 +1 @@ +fixed Entity.Dispose when using multiple EntityMap/MultiMap with the same component key (#123) \ No newline at end of file diff --git a/source/DefaultEcs/EntityQueryBuilder.cs b/source/DefaultEcs/EntityQueryBuilder.cs index e0fdff98..67e0f41c 100644 --- a/source/DefaultEcs/EntityQueryBuilder.cs +++ b/source/DefaultEcs/EntityQueryBuilder.cs @@ -355,7 +355,7 @@ internal EntityQueryBuilder(World world, bool withEnabledEntities) _nonReactSubscriptions = new List>(); _addCreated = withEnabledEntities; - _subscriptions.Add((s, w) => w.Subscribe(s.Remove)); + _subscriptions.Add((s, w) => w.Subscribe(s.Remove)); _withFilter[World.IsAliveFlag] = true; if (withEnabledEntities) { diff --git a/source/DefaultEcs/Technical/EntityContainerWatcher.cs b/source/DefaultEcs/Technical/EntityContainerWatcher.cs index 8e8905f8..99f02061 100644 --- a/source/DefaultEcs/Technical/EntityContainerWatcher.cs +++ b/source/DefaultEcs/Technical/EntityContainerWatcher.cs @@ -101,7 +101,7 @@ public void CheckedAdd(in ComponentDisabledMessage message) } } - public void Remove(in EntityDisposedMessage message) => _container.Remove(message.EntityId); + public void Remove(in EntityDisposingMessage message) => _container.Remove(message.EntityId); public void Remove(in EntityEnabledMessage message) => _container.Remove(message.EntityId); diff --git a/source/DefaultEcs/World.cs b/source/DefaultEcs/World.cs index 67c51180..fa3e1da6 100644 --- a/source/DefaultEcs/World.cs +++ b/source/DefaultEcs/World.cs @@ -479,7 +479,7 @@ public IDisposable SubscribeEntityDisposed(EntityDisposedHandler action) { IEnumerable GetSubscriptions(EntityDisposedHandler a) { - yield return Subscribe((in EntityDisposingMessage message) => action(new Entity(WorldId, message.EntityId))); + yield return Subscribe((in EntityDisposingMessage message) => a(new Entity(WorldId, message.EntityId))); yield return Subscribe((in WorldDisposedMessage _) => { foreach (Entity entity in this)