This repository was archived by the owner on Mar 8, 2025. It is now read-only.
Fix native collections leak on Unity v2021+#31
Open
JayPeet wants to merge 1 commit into
Open
Conversation
…ble with unity to when UnityWebRequest was introduced (as it has always implemented IDisposable, but no one ever seemed to call it :( )
Author
|
False alarm, I was seeing errors relating to it from previous runs of the plugin. |
Author
|
Actually, this sometimes still has the issue. I'll look into it some more |
|
Is this going to be merged? I would love to see this bug fixed. |
Author
|
I would love to, but it ended up not fully fixing the issue. I haven't had time to come back and resolve it :( |
|
I can confirm that on my machine this fixed the problem. It also wouldn't allow me to build before when I had the bug. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dispose was not called on the UnityWebRequest, which in newer versions of unity causes a memory leak.
disposeUploadHandlerOnDispose defaults to true, so it will also implicitly dispose that class.
This is backwards compatible to unity 2018, when the UnityWebRequest class was introduced, as it has always implement IDisposable (see: https://github.com/Unity-Technologies/UnityCsReference/blob/2018.1/Modules/UnityWebRequest/Public/UnityWebRequest.bindings.cs)