Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubpa committed May 14, 2021
1 parent 2c25a47 commit b98fa1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

project(UECS VERSION 0.16.0)
project(UECS VERSION 0.16.1)
message(STATUS "[Project] ${PROJECT_NAME}")

include(cmake/InitUCMake.cmake)
Expand Down
10 changes: 5 additions & 5 deletions src/core/Archetype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ std::size_t Archetype::Erase(EntityAddress addr) {

entityNum--;

if (chunk->Empty()) {
nonFullChunks.erase(addr.chunkIdx);
chunk->~Chunk();
world->GetUnsyncResource()->deallocate(chunk, sizeof(Chunk), alignof(Chunk));
chunks.erase(std::find(chunks.begin(), chunks.end(), chunk));
while (!chunks.empty() && chunks.back()->Empty()) {
nonFullChunks.erase(chunks.size() - 1);
chunks.back()->~Chunk();
world->GetUnsyncResource()->deallocate(chunks.back(), sizeof(Chunk), alignof(Chunk));
chunks.pop_back();
}

return movedEntityIdx;
Expand Down

0 comments on commit b98fa1c

Please sign in to comment.