meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.15k stars 2.47k forks source link

Possible memory leak in `html/janus.js` #1914

Closed vladexologija closed 4 years ago

vladexologija commented 4 years ago

Hi there,

I think there is a possible memory leak in html/janus.js. There are listeners declared on lines https://github.com/meetecho/janus-gateway/blob/11d78977f333bcadf3c34d27f1e30225f19befbf/html/janus.js#L66 https://github.com/meetecho/janus-gateway/blob/11d78977f333bcadf3c34d27f1e30225f19befbf/html/janus.js#L325 but I couldn't find window.removeEventListener in the destroySession method.

Thanks ahead 👍

lminiero commented 4 years ago

I thought they were removed automatically when the page is refreshed? They are not bound to the session (and so shouldn't be removed in destroySession in case), but to the Janus.init, which means they're only done once when the page is loaded.

lminiero commented 4 years ago

Closing.