Skip to content

Commit

Permalink
xlua.release没处理反向映射map,不符合预期
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Jan 10, 2018
1 parent f814a1c commit 3fd81db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/XLua/Src/ObjectTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,11 @@ internal void ReleaseCSObj(RealStatePtr L, int index)
int udata = LuaAPI.xlua_tocsobj_safe(L, index);
if (udata != -1)
{
objects.Replace(udata, null);
object o = objects.Replace(udata, null);
if (o != null && reverseMap.ContainsKey(o))
{
reverseMap.Remove(o);
}
}
}

Expand Down

0 comments on commit 3fd81db

Please sign in to comment.