Skip to content

ZxingScannerComponent is not releasing all resources - BrowserCodeReader still trying to decode after ngDestroy #557

@RafalOddslife

Description

@RafalOddslife

Describe the bug
BrowserCodeReader is trying to decode even after destroying ZxingScannerComponent
Affected version: "@zxing/ngx-scanner": "^17.0.1"

Code

<button (click)="scannerVisible = !scannerVisible">Toggle scanner</button>
<zxing-scanner *ngIf="scannerVisible"></zxing-scanner>

To Reproduce
Steps to reproduce the behavior:

  1. Go to simple repro in stackblitz
  2. Use toggle button to init and destroy zxing-scanner component (the more you do this, the bigger the leakage)
  3. Open chrome devtools, open Performance tab and capture new recording
  4. BrowserCodeReader is still trying to decode even after destroying component

Expected behavior
All resources released

Screenshots
image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions