Comments (8)
the fix is indeed not addressing the root of the problem. with my upcoming vacation I'm not sure when I will find time to look deeper into it that's why I keep the issue open.
from ngx-scanner.
Is this still the case with the version from today? From looking at the code this should be resolved via #557
from ngx-scanner.
Is this still the case with the version from today?
Yes, your PR fixed problem with disposing scanning process on component destroy.
This issue is caused by initializing scanning process twice when enable
input is set to true. Stackblitz repro is based on the newest version 17.0.2
from ngx-scanner.
Damnit, as setting enable to false calls the reset method I was hoping this would be resolved. I'll take a look then. Thanks
from ngx-scanner.
If you setup breakpoint in ZXingScannerComponent.scanFromDevice you'll see it's called twice on component creation and this._scanSubscription
is overwritten.
from ngx-scanner.
Good point! Thank you
from ngx-scanner.
plz test 17.0.3
from ngx-scanner.
I'm afraid it solves my repro but the root of the problem is more complicated
IMO these leaks are caused by:
- calling async methods from sync context (
ngOnInit
andenable
setter) - parent component/template can toggle
enable
flag many times which leads to multiple ZxingScannerComponent.init calls without clearing previously created scanning processes
Simple example:
<button (click)="scannerEnable = !scannerEnable">Toggle scanner enable</button>
<zxing-scanner [enable]="scannerEnable"></zxing-scanner>
it causes leak when you toggle enable flag few times quickly
from ngx-scanner.
Related Issues (20)
- Property '"autofocusEnabled"' is incompatible with index signature. HOT 2
- Cannot Scan code 93 and Codabar barcodes. No errors in the console as well
- cannot scan UPC_E barcodes
- Cannot read properties of undefined (reading stop)
- [Firefox-android] Permission issue HOT 1
- Please support Angular 17 HOT 1
- Cordova Android app
- Area of intreset feature
- Windows 11, camera shows screen stream instead
- Error reading QR code in Chrome
- when you open a scanner multiple times the CPU usage gets to 100% HOT 3
- Dependency bug
- Add Support for willReadFrequently to Optimize Canvas Readback Performance HOT 2
- ZxingScannerComponent is not releasing all resources - BrowserCodeReader still trying to decode after ngDestroy HOT 3
- iPadOS black screen after installation to homescreen, works on safari HOT 4
- Support v0.21.0 zxing library HOT 1
- Upgrade to Angular 18.x HOT 1
- Error al intentar implementar esta libreria en angular 17 HOT 1
- DOMException: setPhotoOptions failed when stoping scanner after upgrade from v17.0.1 to 17.0.2 or above HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-scanner.