【发布时间】:2018-03-31 15:06:14
【问题描述】:
如果我有一个向 Lua 公开的 C 函数,我将一个 userdata 对象作为在 lua 中定义的参数传入,C 函数实际上可以在 lua 端将该变量设置为“nil”吗?
// From C++
static void Delete(lua_State* L){
// the first param will be userdata and I want to set it so after this call in lua happens whatever was passed in will be nil
}
-- from lua
local obj = CreateUserDataObject()
Delete(obj)
--I would want obj to now be nil
【问题讨论】:
标签: lua