File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,13 @@ export default {
210210 this .cameraInstance = null
211211 } else {
212212 this .cameraInstance = await Camera (this .constraints , this .$refs .video )
213+
214+ // if the component is destroyed before `cameraInstance` resolves a
215+ // `beforeDestroy` hook has no chance to clear the remaining camera
216+ // stream.
217+ if (this .destroyed ) {
218+ this .cameraInstance .stop ()
219+ }
213220 }
214221 },
215222
Original file line number Diff line number Diff line change @@ -186,6 +186,13 @@ export default {
186186 this .cameraInstance = null
187187 } else {
188188 this .cameraInstance = await Camera (this .constraints , this .$refs .video )
189+
190+ // if the component is destroyed before `cameraInstance` resolves a
191+ // `beforeDestroy` hook has no chance to clear the remaining camera
192+ // stream.
193+ if (this .destroyed ) {
194+ this .cameraInstance .stop ()
195+ }
189196 }
190197 },
191198
You can’t perform that action at this time.
0 commit comments