Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
753 stars 191 forks source link

fix: Fix memory leak in Stats Sample #816

Closed karasusan closed 2 years ago

karasusan commented 2 years ago

The memory usage in Stats sample significantlly increased when updating statistics more frequently. This is a native memory resource of the RTCStatsReport. GC collection can't catch up the speed of inscreasing memory usage.

This PR fixes the issue by calling Dispose method explicitly to destroy the native resource.