You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UnityWebRequest has a Dispose method, which we should call when the request completes (or fails). We're currently explicitly disposing the "download handler" but not the request itself. This could lead to memory growth if the garbage collector doesn't clean these up right away. And it also creates unnecessary work for the finalizer, which has performance implications.
UnityWebRequest also has disposeDownloadHandlerOnDispose and disposeUploadHandlerOnDispose properties, and they're set to true by default, so we can probably switch to disposing the request instead of the handler.
The text was updated successfully, but these errors were encountered:
Mentioned on the forum here:
https://community.cesium.com/t/potential-memory-leak-due-to-unsafe-use-of-unitywebrequest/38030
UnityWebRequest
has aDispose
method, which we should call when the request completes (or fails). We're currently explicitly disposing the "download handler" but not the request itself. This could lead to memory growth if the garbage collector doesn't clean these up right away. And it also creates unnecessary work for the finalizer, which has performance implications.UnityWebRequest
also hasdisposeDownloadHandlerOnDispose
anddisposeUploadHandlerOnDispose
properties, and they're set to true by default, so we can probably switch to disposing the request instead of the handler.The text was updated successfully, but these errors were encountered: