Updating Playername and then leaving play mode results in memory leak

Hello,
when using the new Player name management BETA in Authentication 2.5.0-pre.3 I get an memory leak after updating my playername the moment I leave the play mode in the editor. See full stack trace below:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator) (at /Users/bokken/build/output/unity/unity/Runtime/Export/NativeArray/NativeArray.cs:69)
UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[]) (at /Users/bokken/build/output/unity/unity/Modules/UnityWebRequest/Public/UploadHandler/UploadHandler.bindings.cs:95)
Unity.Services.Authentication.AuthenticationApiClient:BuildWebRequest(String, WebRequestVerb, ApiRequestOptions, IApiConfiguration) (at Library/PackageCache/com.unity.services.authentication@2.5.0-pre.3/Runtime/Network/AuthenticationApiClient.cs:183)
Unity.Services.Authentication.<SendAsync>d__19`1:MoveNext() (at Library/PackageCache/com.unity.services.authentication@2.5.0-pre.3/Runtime/Network/AuthenticationApiClient.cs:124)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(<SendAsync>d__19`1&)
Unity.Services.Authentication.AuthenticationApiClient:SendAsync(String, WebRequestVerb, ApiRequestOptions, IApiConfiguration, CancellationToken)
Unity.Services.Authentication.AuthenticationApiClient:PostAsync(String, ApiRequestOptions, IApiConfiguration, CancellationToken) (at Library/PackageCache/com.unity.services.authentication@2.5.0-pre.3/Runtime/Network/AuthenticationApiClient.cs:35)
Unity.Services.Authentication.Generated.Api.<UpdateNameAsync>d__10:MoveNext() (at Library/PackageCache/com.unity.services.authentication@2.5.0-pre.3/Runtime/Generated/PlayerNames/Api/PlayerNamesApi.cs:213)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(<UpdateNameAsync>d__10&)
Unity.Services.Authentication.Generated.Api.PlayerNamesApi:UpdateNameAsync(String, UpdateNameRequest, CancellationToken)
Unity.Services.Authentication.<UpdatePlayerNameAsync>d__118:MoveNext() (at Library/PackageCache/com.unity.services.authentication@2.5.0-pre.3/Runtime/AuthenticationServiceInternal.cs:508)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(<UpdatePlayerNameAsync>d__118&)
Unity.Services.Authentication.AuthenticationServiceInternal:UpdatePlayerNameAsync(String)

What version of the editor are you using?

I’ve confirmed with the engineers, they are aware and are working on a fix.

Thanks!

1 Like