Description:
UnloadAllAssetBundles will unload all the AssetBundle waiting for any pending load operation, but it won't wait for any unload operation on the AssetBundle itself. Due to that, the bundle will be unloaded while the unload operation is still pending, and when the operation executes it will crash because the bundle has already been unloaded.
How to reproduce:
1. Open the attached “IN-121566.zip” project
2. Click on Test > Build Bundles in the toolbar
3. Open the “SampleScene”
4. Enter Play Mode
5. Observe the crash
Reproducible in: 2023.1.0a1, 6000.0.60f1, 6000.2.8f1, 6000.3.0b7, 6000.4.0a3
Reproducible on: Windows 11
Not reproducible on: No other environments tested
First few lines of stacktrace:
0x00007FF9187B9095 (Unity) GetAssetBundlePrefix
0x00007FF9187B8899 (Unity) GetAbsoluteAssetBundlePrefix
0x00007FF9187A4885 (Unity) AssetBundleUnloadOperation::GetAssetBundleAbsolutePathPrefix
0x00007FF9187A5E4A (Unity) AssetBundleUnloadOperation::Perform