Browse Source

storage: minor changes

Michele Caini 4 năm trước cách đây
mục cha
commit
42a763031c
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/entt/entity/storage.hpp

+ 1 - 1
src/entt/entity/storage.hpp

@@ -227,9 +227,9 @@ class basic_storage_impl: public basic_sparse_set<Entity, typename std::allocato
 
             for(auto pos = length; pos < bucket; ++pos) {
                 alloc_traits::deallocate(allocator, packed[pos], packed_page);
+                bucket_alloc_traits::destroy(bucket_allocator, std::addressof(packed[pos]));
             }
 
-            std::destroy(packed, packed + bucket);
             bucket_alloc_traits::deallocate(bucket_allocator, packed, bucket);
 
             packed = mem;