unity-technologies / zombieobjectdetector Goto Github PK
View Code? Open in Web Editor NEWTool for detecting "Fake Null" C# instances.
License: Other
Tool for detecting "Fake Null" C# instances.
License: Other
When you match an expression against null, the compiler guarantees that no user-overloaded == or != operator is invoked.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/is
This might be more readable than the current method of doing "== null" twice on the same object.
It would be good if the logic of zombie detection was separated from its presentation to the user.
When a zombie object is detected, rather than printing directly to the log, a callback should be invoked. Then we can make different types of presentation. For example, we could display the results in an editor window.
Currently the search only starts from static fields of classes.
We could also start searching from Scene.GetRootGameObjects.
This would cover cases where a long running "manager" objects has a non-static field that points to zombies.
InvalidCastException: Specified cast is not valid.
System.Reflection.Assembly.Equals (System.Object o) (at :0)
System.Collections.Generic.ObjectEqualityComparer1[T].Equals (T x, T y) (at <eae584ce26bc40229c1b1aa476bfa589>:0) System.Collections.Generic.HashSet
1[T].Contains (T item) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
CSharpZombieDetector.ZombieObjectDetector+SearchContext.TestAndRecurse (System.Object obj) (at Library/PackageCache/com.unity.zombieobjectdetector@20b894e8c2/Runtime/ZombieObjectDetector.cs:134)
See README.md
.
Currently we perform detection by doing obj.ToString() == "null"
. This creates a temporary string that must eventually be garbage-collected.
It'd be better (?) to do something along the lines of:
System.Object o = ...; // (current object iteration logic)
UnityEngine.Object uo = o as UnityEngine.Object;
bool zombie = o != null && uo == null;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.