diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index c8ce79905d..d88a477932 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -284,7 +284,13 @@ module.exports = React.createClass({ this.setState({ electron_settings: settings }); }, - _refreshMediaDevices: function() { + _refreshMediaDevices: function(stream) { + if (stream) { + // kill stream so that we don't leave it lingering around with webcam enabled etc + // as here we called gUM to ask user for permission to their device names only + stream.getTracks().forEach((track) => track.stop()); + } + Promise.resolve().then(() => { return CallMediaHandler.getDevices(); }).then((mediaDevices) => {