Skip to content

Commit

Permalink
Fixed memory leak during .Add and .Remove.
Browse files Browse the repository at this point in the history
  • Loading branch information
genaray committed Jan 29, 2023
1 parent e6d300a commit 223be81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Arch.Samples/Systems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ public override void Update(in GameTime time)
sprite.Color.G += (byte)(_gameTime.ElapsedGameTime.TotalMilliseconds * 0.08);
sprite.Color.B += (byte)(_gameTime.ElapsedGameTime.TotalMilliseconds * 0.08);
});

World.Add<int>(in _entitiesToChangeColor);
World.Remove<int>(in _entitiesToChangeColor);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Arch/Arch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@

<PackageId>Arch</PackageId>
<Title>Arch</Title>
<Version>1.1.7</Version>
<Version>1.1.8</Version>
<Authors>genaray</Authors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Description>A high performance c# net.6 and net.7 archetype based ECS ( Entity component system ).</Description>
<PackageReleaseNotes>
Fixed structural changes memory leak.
Added destroy, set, add and remove operations for QueryDescriptions to target a range of entities.
Fixed proper entityinfo update.
Small performance improvements.
</PackageReleaseNotes>
<PackageTags>c#;.net;.net6;.net7;ecs;game;entity;gamedev; game-development; game-engine; entity-component-system;</PackageTags>
Expand Down
1 change: 1 addition & 0 deletions src/Arch/Core/Utils/CompileTimeStatics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ public static int GetHashCode(ref SpanBitSet obj)
{
if ((value & 1) != 1)
{
value >>= 1;
continue;
}

Expand Down

0 comments on commit 223be81

Please sign in to comment.