diff --git a/native/cocos/editor-support/spine-wasm/spine-wasm.cpp b/native/cocos/editor-support/spine-wasm/spine-wasm.cpp index cc486db5c5a..29947efe70d 100644 --- a/native/cocos/editor-support/spine-wasm/spine-wasm.cpp +++ b/native/cocos/editor-support/spine-wasm/spine-wasm.cpp @@ -96,16 +96,9 @@ void SpineWasmUtil::destroySpineSkeleton(Skeleton* skeleton) { } uint32_t SpineWasmUtil::queryStoreMemory(uint32_t size) { - if (s_mem) { - if (s_memSize < size) { - delete[] s_mem; - s_mem = new uint8_t[size]; - s_memSize = size; - } - } else { - s_mem = new uint8_t[size]; - s_memSize = size; - } + s_mem = new uint8_t[size]; + s_memSize = size; + return (uint32_t)s_mem; }