AP_Scripting: ensure new user data is zero
this prevents use of uninitialised data for user objects created in lua, giving more predictable behaviour
This commit is contained in:
parent
1530dbde3d
commit
615838a7d4
@ -1189,7 +1189,9 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size) {
|
||||
api_incr_top(L);
|
||||
luaC_checkGC(L);
|
||||
lua_unlock(L);
|
||||
return getudatamem(u);
|
||||
void *udata = getudatamem(u);
|
||||
memset(udata, 0, size);
|
||||
return udata;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user