Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
0
Found in [Package]
1.1.5
Issue ID
ADDR-1634
Regression
No
OnDisable and OnDestroy not called on ScriptableObject when Loaded/Unloaded from Addressables
How to reproduce:
1. Open the attached "Dumpster Fire.zip" project
2. Build to Standalone with Development Build option -> run the Build
3. Click on the "Load" button -> click on the "Release" button -> click on "Unload Trash" button
4. See the Player.log (C:\\Users\\username\\AppData\\Local\\Unity\\Editor\\Editor.log)
Expected result: OnDisable and OnDestroy is called on ScriptableObject when Loaded/Unloaded from Addressables
Actual result: OnDisable and OnDestroy not called on ScriptableObject when Loaded/Unloaded from Addressables
Reproducible with: 2018.4.30f1 (1.1.5), 2019.4.16f1 (1.8.3), 2020.1.15f1 (1.8.5), 2020.2.0b14 (1.16.10), 2021.1.0a8 (1.16.13)
Notes:
- The issue was tested on UWP and Standalone
- The issue also appears on Editor, but only OnDestroy is missing
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
- Skinned Mesh Renderer with multiple Animator Components does not render when "Optimize Game Objects" is enabled
- [iOS]Certain characters are not displayed when using iOS devices with 18 OS and newer
- Trees do not render in 'Unity Terrain - URP Demo Scene'
- Silent crash when clicking in Scene View in a specific project
- The Player renders black on a Quest headset when MSAA, Post Processing, and Spacewarm depth submission are enabled
Resolution Note:
This case is blocked until fogbug case 1329042 is resolved by the scripting team.
The Addressable and AssetBundle teams depends on the handling of the ScriptableObject.OnDestroy() situation by them in order for an appropriate solution to be implemented in the Addressable package.
Long story short : ScriptableObject.OnDestroy() is inconsistently called throughout the engine. After a detailed investigation on our side, it looks like any fix will cause some ripple effects in other systems that depend on the old behavior, which is why this task has been transferred to the scripting since they have the expertise to handle this case.
Please reach out to me, Joseph Scheinberg or Alexandre Mutel for additional information.
A backporting of this fix seems very unlikely.