"Attempting to use an invalid operation handle" when UnloadSceneAsync completes

>    AsyncOperationBase`1 UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1:get_InternalOp ()+0x26 at (my project path)\Library\PackageCache\com.unity.addressables@1.1.10\Runtime\ResourceManager\AsyncOperations\AsyncOperationHandle.cs:[186:21-186:90]    C#
     Void UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1:Release ()+0x2 at (my project path)\Library\PackageCache\com.unity.addressables@1.1.10\Runtime\ResourceManager\AsyncOperations\AsyncOperationHandle.cs:[68:13-68:50]    C#
     Void UnityEngine.ResourceManagement.ChainOperation`2:smile:estroy ()+0x7 at (my project path)\Library\PackageCache\com.unity.addressables@1.1.10\Runtime\ResourceManager\AsyncOperations\ChainOperation.cs:[49:13-49:35]    C#
     Void UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:smile:ecrementReferenceCount ()+0x71 at (my project path)\Library\PackageCache\com.unity.addressables@1.1.10\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:[136:17-136:27]    C#
     Void UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1:Release ()+0x7 at (my project path)\Library\PackageCache\com.unity.addressables@1.1.10\Runtime\ResourceManager\AsyncOperations\AsyncOperationHandle.cs:[68:13-68:50]    C#
     Void UnloadSceneOp:UnloadSceneCompleted (AsyncOperation)+0x16 at (my project path)\Library\PackageCache\com.unity.addressables@1.1.10\Runtime\ResourceManager\ResourceProviders\SceneProvider.cs:[143:21-143:49]    C#
     Void UnityEngine.AsyncOperation:InvokeCompletionEvent ()+0x16 at :-1    C#

From the Game view and Hierarchy it looks like the unload happens, however each time this happens I’m seeing leaks in the Addressable Profiler:

5832454--618643--upload_2020-5-11_13-55-23.png

An experiment I’ve done: if in ChainOperation.cs one adds this line to the start of Destroy(): if(m_WrappedOp.IsValid()) the exception doesn’t happen however the UnloadSceneOps still get leaked.

Thanks for the report! Which version of Addressables are you using? Could you also file a bug report for us? Unity QA: Building quality with passion