You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static List GetAlreadyDestroyedObjectNames(){
List names = new List();
foreach(var cache in multiState.Values){
foreach(var o in cache.objMap.Keys){
if(o is Object &&(o as Object).Equals(null)){
names.Add(cache.objNameDebugs[o]);
}
}
}
return names;
}
The text was updated successfully, but these errors were encountered:
SLuaForUnity有这么一段代码用于检查内存泄漏。但是有点疑问:
第一是从objMap.Keys拿出来的o已经是System.Object类型,为什么在之后的if判断中还要重复转为System.Object类型。因为在IDE里查看if语句里的Object也是System.Object类型。
第二是,已经为null的o,还可以作为key去字典里查找么?
public static List GetAlreadyDestroyedObjectNames(){
List names = new List();
foreach(var cache in multiState.Values){
foreach(var o in cache.objMap.Keys){
if(o is Object &&(o as Object).Equals(null)){
names.Add(cache.objNameDebugs[o]);
}
}
}
return names;
}
The text was updated successfully, but these errors were encountered: