Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
739 stars 185 forks source link

fix: Fix memory leak on macOS/iOS when streaming high resolution video #872

Closed karasusan closed 1 year ago

karasusan commented 1 year ago

This PR fixes memory leak on macOS/iOS. Fix this issue https://github.com/Unity-Technologies/com.unity.webrtc/issues/868

First, fixed the issue of the reference counter of Objective-C. It is needed to call release message explicitly.

[m_texture release];

Second, the buffer pool should be set the limit of number of creating buffer. Currently the limit number is set 10 which should be enough in this situation.