Search Issue Tracker
Fixed in 5.4.0
Votes
29
Found in
5.1.2f1
Issue ID
723842
Regression
Yes
GetHashCode() returns 0 for destroyed GameObjects and MonoBehaviours in Builds, but not in the Editor
To reproduce:
1. Open the attached project.
2. Open the DictionaryTests.unity scene.
3. Press Play in the Editor.
4. Observe the console output.
5. Note that the log indicates that the contents of the dictionary are identical before and after the gameobject has been destroyed.
6. Open the Build Settings dialog and ensure that DictionaryTests.unity is the only scene in the list.
7. Click Build and Play.
8. Wait for the application to start (click through the screen resolution dialog if necessary).
9. Wait for the application to quit automatically.
10. Open the player log file.
11. Observe the debug output.
12. Note that log now indicates that the hashcode of the destroyed object now changes to zero.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mesh.GetIndexBuffer() requires Mesh's 'Read/Write' flag to be enabled to get its index buffer data in Builds
- [Backport] [Sprite Atlas V1] Editor crashes when calling SpriteAtlasUtility.PackAtlases
- Deterministic builds have different files when built from the same project
- PlayerBuildInterface.ExtraTypesProvider no longer provides types to IL2CPP
- Touch input is reset in Device Simulator when Unity Remote is killed
mayasarii876
Mar 09, 2022 03:34
http://103.56.148.201/
http://103.56.148.201/newmpo
http://103.56.148.201/mpo17
http://103.56.148.201/mpomm
http://103.56.148.201/mpotower
http://103.56.148.201/parisklub
http://103.56.148.201/juraganslot
http://103.56.148.201/mpo500
http://103.56.148.201/mpokick
http://103.56.148.201/mpoyes
http://103.56.148.201/xyzklub
http://103.56.148.201/betmpo
http://103.56.148.201/ogslot88
http://103.56.148.201/hoki777
http://103.56.148.201/mpojuta
http://103.56.148.201/299slot
http://103.56.148.201/mpo188
http://103.56.148.201/mpogacor
http://103.56.148.201/mpo300
http://103.56.148.201/rgo365
http://103.56.148.201/kingdom288
http://103.56.148.201/wigompo
http://103.56.148.201/mpo8899
http://103.56.148.201/mpopelangi
http://103.56.148.201/mpo555
http://103.56.148.201/dutampo
http://103.56.148.201/klik368
http://103.56.148.201/388hero
http://103.56.148.201/19dewa
http://103.56.148.201/mpoxl
http://103.56.148.201/mpoas
http://103.56.148.201/mposun
http://103.56.148.201/qqslot
http://103.56.148.201/mposport
http://103.56.148.201/dewa234
http://103.56.148.201/mesinmpo
Michael Thomas
Nov 18, 2015 22:14
Amongst other things, this bug means that I wrote some code while testing in the editor attempting to remove all recently destroyed objects from my HashSet and it worked fine. In a standalone game build, however, it's not actually possible as far as I can tell to remove a destroyed GameObject from an existing HashSet. I've tried both RemoveWhere and looping through and using Remove() directly for the destroyed objects and both just fail to remove anything, presumably because of the hashcode mismatch.
The fact that this removal is not possible is really, really unfortunate. The fact that it's different in the editor versus standalone is HORRIBLE and now has me paranoid that any testing in the editor is entirely pointless.
umauj
Oct 08, 2015 14:39
This bug is a NIGHTMARE! The moment you cannot trust the most basic functions anymore, like when working with HashSets or Dictionaries that use the HashCode as key, everything falls apart. Please fix asap!
t0bi
Oct 08, 2015 14:17
I just committed a bugreport that basically says the same. Issue #734454