// %override wxLua_function_isrefed // %function bool isrefed(void* object) static int LUACALL wxLua_function_isrefed(lua_State *L) { bool ret = wxluaR_isrefed(L, 1, &wxlua_lreg_refs_key) != LUA_NOREF; lua_pushboolean(L, ret); return 1; }
int wxLuaDebugData::RefTable(lua_State* L, int stack_idx, int* flag_type, int extra_flag, wxArrayInt& references) { wxCHECK_MSG(L, LUA_NOREF, wxT("Invalid lua_State")); int lua_ref = LUA_NOREF; if (lua_istable(L, stack_idx)) { if (flag_type) *flag_type |= (WXLUA_DEBUGITEM_IS_REFED | extra_flag); lua_ref = wxluaR_isrefed(L, stack_idx, &wxlua_lreg_debug_refs_key); // don't duplicate refs if (lua_ref == LUA_NOREF) { lua_ref = wxluaR_ref(L, stack_idx, &wxlua_lreg_debug_refs_key); references.Add(lua_ref); } } return lua_ref; }