-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(scanner): workers not always terminated
The computed property `shouldScan` in QrcodeStream is the source of truth for the scanners state. Therefore each `keepScanning` call receives a function enabling it to check `shouldScan`s value outside of the components context. Since computed properties are evaluated in an asynchronous manner, a running scanner might miss point where `shouldScan` is actually `false`. When `keepScanning` is called many times in a row, new web workers are spawned endlessly without being terminated, causing a major memory leak. Now fixed by putting the action to terminate scanners in the same watcher where scanners are started.
- Loading branch information
Showing
2 changed files
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters