mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
fix(lua): fix pointer.allocate allocating the wrong number of bytes (#2941)
This commit is contained in:
parent
6f8490f450
commit
a46d6d0fae
@ -107,7 +107,7 @@ namespace lua::memory
|
|||||||
// Returns: pointer: A pointer to the newly allocated memory.
|
// Returns: pointer: A pointer to the newly allocated memory.
|
||||||
static pointer allocate(int size, sol::this_state state)
|
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"];
|
big::lua_module* module = sol::state_view(state)["!this"];
|
||||||
module->m_allocated_memory.push_back(mem);
|
module->m_allocated_memory.push_back(mem);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user