2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-24 09:16:39 +00:00

fix: do not reallocate assets for dynamic asset pool

This commit is contained in:
Jan
2024-12-31 12:39:09 +01:00
parent 306ffb730e
commit 80c4a9a2ae
2 changed files with 5 additions and 10 deletions

View File

@@ -29,11 +29,6 @@ public:
{
GlobalAssetPool<T>::UnlinkAssetPool(this);
for (auto& entry : m_assets)
{
delete entry->Asset();
}
m_assets.clear();
m_asset_lookup.clear();
}
@@ -42,10 +37,6 @@ public:
{
const auto normalizedName = XAssetInfo<T>::NormalizeAssetName(xAssetInfo->m_name);
T* newAsset = new T();
memcpy(newAsset, xAssetInfo->Asset(), sizeof(T));
xAssetInfo->m_ptr = newAsset;
auto* pAssetInfo = xAssetInfo.get();
m_asset_lookup[normalizedName] = pAssetInfo;
m_assets.emplace_back(std::move(xAssetInfo));