From de3d42cc281c29c7ebd11c3a399d81971e998d09 Mon Sep 17 00:00:00 2001 From: David Werth Date: Thu, 25 Apr 2024 13:14:03 +0200 Subject: [PATCH] #559 ZxingScannerComponen.init method called twice when enable flag is set to true (leak once again) --- projects/zxing-scanner/src/lib/zxing-scanner.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/zxing-scanner/src/lib/zxing-scanner.component.ts b/projects/zxing-scanner/src/lib/zxing-scanner.component.ts index b1b43d5..2f8d45a 100644 --- a/projects/zxing-scanner/src/lib/zxing-scanner.component.ts +++ b/projects/zxing-scanner/src/lib/zxing-scanner.component.ts @@ -343,6 +343,10 @@ export class ZXingScannerComponent implements OnInit, OnDestroy { @Input() set enable(enabled: boolean) { + if (this._enabled === Boolean(enabled)) { + return; + } + this._enabled = Boolean(enabled); if (!this._enabled) {