From e515ce85882a2a2d165d7082a95a99b41d91a6d8 Mon Sep 17 00:00:00 2001 From: LJW-Dev <48092720+LJW-Dev@users.noreply.github.com> Date: Sun, 22 Mar 2026 21:04:11 +0800 Subject: [PATCH] chore: replace "new" keyword with correct memory allocation --- src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp | 2 +- src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp b/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp index 7ce56680..b471fd3b 100644 --- a/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp +++ b/src/ObjLoading/Game/T6/BSP/Linker/ClipMapLinker.cpp @@ -161,7 +161,7 @@ namespace BSP // even official maps instead use terrain or brushes to cover where the collision should be. clipMap->numStaticModels = bsp->colWorld.xmodels.size(); - clipMap->staticModelList = new cStaticModel_s[clipMap->numStaticModels]; + clipMap->staticModelList = m_memory.Alloc(clipMap->numStaticModels); for (unsigned int i = 0; i < clipMap->numStaticModels; i++) { diff --git a/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp b/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp index 57d27677..672b0a6c 100644 --- a/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp +++ b/src/ObjLoading/Game/T6/BSP/Linker/GfxWorldLinker.cpp @@ -158,8 +158,8 @@ namespace BSP { size_t modelCount = bsp->gfxWorld.xmodels.size(); gfxWorld->dpvs.smodelCount = modelCount; - gfxWorld->dpvs.smodelInsts = new GfxStaticModelInst[modelCount]; - gfxWorld->dpvs.smodelDrawInsts = new GfxStaticModelDrawInst[modelCount]; + gfxWorld->dpvs.smodelInsts = m_memory.Alloc(modelCount); + gfxWorld->dpvs.smodelDrawInsts = m_memory.Alloc(modelCount); for (size_t modelIdx = 0; modelIdx < modelCount; modelIdx++) {