Search Issue Tracker
Fixed in 1.5.x or higher
Votes
3
Found in [Package]
1.2.4
Issue ID
1190427
Regression
Yes
[Addressables] Exception is thrown when unloading Addressable Scene with UnloadSceneAsync(loadHandle)
How to reproduce:
1. Open user's attached project ("Addressable Unload Scene Bug.zip") using the EnvIronman VM (optional) (more information in Edit).
2. Open SampleScene scene
3. Enter Play mode
4. Press 'L' to load AddressableScene scene
5. Press 'U' to unload AddressableScene scene
Expected result: No exception is thrown
Actual result: Exception is thrown
Reproducible with: 2018.4.11f1, 2019.2.9f1, 2019.3.0b6, 2020.1.0a8 (all version were tested with Addressables 1.1.9, 1.2.4)
Not reproducible with: 2018.4.11f1, 2019.2.9f1, 2019.3.0b6, 2020.1.0a8 (all version were tested with 1.1.7)
Comments (3)
-
HLSeanStevens
Feb 08, 2020 00:29
This issue was fixed in: [1.5.0] - 2019-12-09
https://docs.unity3d.com/Packages/com.unity.addressables@1.6/changelog/CHANGELOG.html
"Fixed issue where unloading a scene was throwing an invalid handle error." -
RunninglVlan
Nov 13, 2019 13:58
Yeah, and I reproduced it using Addressables v1.3.8 (and Unity v2019.3.0b8).
-
RunninglVlan
Nov 13, 2019 13:44
Some more info:
Actual exception: "Exception: Attempting to use an invalid operation handle"Because of this Exception `Addressables.UnloadSceneAsync(AsyncOperationHandle).Completed` isn't called.
Did some digging: checked Addressables Event Viewer, and there's some leftover operation every time I load and unload a scene: "UnityEngine.ResourceManagement.ResourceProviders.SceneProvider+UnloadSceneOp, result'', status='None'". Checked frame events, and it seems duplicate unload operation is created:
first there's AsyncOperationCreate - Scene(New Scene)
then AsyncOperationComplete - Scene(New Scene)
then ...Create - ...UnloadSceneOp
then one more ...Create - ...UnloadSceneOp
tehn ...Destroy - Scene(New Scene)
then ...Complete - ...UnloadSceneOp 2 times
and only 1 ...Destroy - ...UnloadSceneOpException isn't thrown using `Addressables.UnloadSceneAsync(SceneInstance)`. Leftover operation is still there with this approach too.
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
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Shader Graph "Zoom Step Size" can be set to 0 even though the zoom still works
- Enabling/Disabling the Deprecated Nodes doesn't apply to the opened Shader Graph unless any Variable is added to the Blackboard
- Group Selection title text size is smaller in renaming than the actual font size
Resolution Note (fix version 1.5.x or higher):
This fix was released toward the end of 2019.