Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Fix memory leak in code sample (#4982)
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois authored Jan 23, 2023
1 parent 22fffc6 commit 774345c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion site/en/blog/audiocontext-setsinkid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ The example below shows you how to request microphone access if needed and direc
const permission = await navigator.permissions.query({ name: "microphone" });
if (permission.state == "prompt") {
// More audio outputs are available when user grants access to the mic.
await navigator.mediaDevices.getUserMedia({ audio: true });
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
stream.getTracks().forEach((track) => track.stop());
}

// Request a list of media devices and filter audio output devices.
Expand Down

0 comments on commit 774345c

Please sign in to comment.