Search Issue Tracker
Property reference is not disposed when it is redeclared in a script and the editor is restarted
How to reproduce:
1. Open the sample Scene of the attached project "1189787.zip"
2. Open the TestSerializeField.cs script
3. Comment the 5th line of the TestSerializeField.cs script
4. Go back to the Editor so that the script recompiles
5. Uncomment the 5th line of the TestSerializeField.cs script
6. Go back to the Editor so that the script recompiles
7. Reopen the project
Expected result: Test field of the TestSerializeField component on the Manager GameObject is set to 0
Actual result: Test field of the TestSerializeField component on the Manager GameObject is set to 5
Reproducible with: 2017.4.33f1, 2018.4.11f1, 2019.1.14f1, 2019.2.8f1, 2019.3.0b6, 2020.1.0a8
Saving the Scene after step 6 will prevent the issue from happening.
Doing the reproduction steps will not trigger a change in the Scene, therefore another change will have to be done to save the Scene.
The issue is reproducible with other variable types as well.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Scene View] Gizmos dropdown disappears while toggling Windzone checkbox with its tooltip open
- Crash in StackAllocator::TryDeallocate when calling ParticleSystemRenderer.BakeMesh
- Modifying scoped registries in project manifest does not update Package Manager UI window
- Models change their position in scene when upgrading project
- Texture 'Read/Write' option does not double the memory in Profiler