Skip to content

Commit

Permalink
Fix #65: Never destroy the PMR allocator to early
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Jun 28, 2024
1 parent 9c78563 commit 4d5c368
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/fastgltf/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2176,9 +2176,6 @@ namespace fastgltf {

Asset& operator=(const Asset& other) = delete;
Asset& operator=(Asset&& other) noexcept {
#if !FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL
memoryResource = std::move(other.memoryResource);
#endif
assetInfo = std::move(other.assetInfo);
extensionsUsed = std::move(other.extensionsUsed);
extensionsRequired = std::move(other.extensionsRequired);
Expand All @@ -2199,6 +2196,10 @@ namespace fastgltf {
textures = std::move(other.textures);
materialVariants = std::move(other.materialVariants);
availableCategories = other.availableCategories;
#if !FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL
// This needs to be last to not destroy the old memoryResource for the current data.
memoryResource = std::move(other.memoryResource);
#endif
return *this;
}
};
Expand Down

0 comments on commit 4d5c368

Please sign in to comment.