fix(lua): fix pointer.allocate allocating the wrong number of bytes (#2941)

This commit is contained in:
Quentin 2024-04-13 17:41:04 +02:00 committed by GitHub
parent 6f8490f450
commit a46d6d0fae

View File

@ -107,7 +107,7 @@ namespace lua::memory
// Returns: pointer: A pointer to the newly allocated memory.
static pointer allocate(int size, sol::this_state state)
{
void* mem = new uint8_t[](size);
void* mem = new uint8_t[size]();
big::lua_module* module = sol::state_view(state)["!this"];
module->m_allocated_memory.push_back(mem);