Browse Source

storage: reset next on clear

Michele Caini 2 years ago
parent
commit
f2a8c0ffe6
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/entt/entity/storage.hpp

+ 6 - 0
src/entt/entity/storage.hpp

@@ -957,6 +957,12 @@ class basic_storage<Entity, Entity, Allocator>
     }
 
 protected:
+    /*! @brief Erases all entities of a storage. */
+    void pop_all() override {
+        base_type::pop_all();
+        next = {};
+    }
+
     /**
      * @brief Assigns an entity to a storage.
      * @param hint A valid identifier.