Bug: A Native Collection has not been disposed, resulting in a memory leak

Unity 2021.3.10, latest User Reporting SDK

It looks like the SDK hooks event handlers to webrequests but doesn’t unhook them when the webrequest is done. I get the following error from time to time in the console:

[Error] A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Byte[ ], Allocator)
UnityUserReportingPlatform.Post() at Assets\Plugins\UserReporting\Scripts\Plugin\UnityUserReportingPlatform.cs:377
375: {
376: UnityWebRequest webRequest = new UnityWebRequest(endpoint, “POST”);
–>377: webRequest.uploadHandler = new UploadHandlerRaw(content);
378: webRequest.downloadHandler = new DownloadHandlerBuffer();
379: webRequest.SetRequestHeader(“Content-Type”, contentType);

Hi,

Could you please let me know when you see this error?

Hello, this happens at seemingly random times in the editor.

Hi,

I’ve spoken to the dev team and it appears to be the known bug that is fixed in the upcoming new version of the User Reporting package. We will release an updated SDK through the package manager, and updated documentation, so please bear with us for a little more!

1 Like

Hello @ValeryNikulina
Any news regarding that package ?

2 Likes