From 1d885c11e076f1a10fac580766f7d06ccaa0b3bb Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 5 Mar 2015 07:49:07 +0100 Subject: [PATCH] fix segfault in zbar init, issue #1059 --- lib/qrscanner.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/qrscanner.py b/lib/qrscanner.py index 38cc1f3d0..419635c91 100644 --- a/lib/qrscanner.py +++ b/lib/qrscanner.py @@ -17,8 +17,11 @@ def scan_qr(config): device = config.get("video_device", "default") if device == 'default': device = '' - proc = zbar.Processor() - proc.init(video_device=device) + _proc = zbar.Processor() + _proc.init(video_device=device) + # set global only if init did not raise an exception + proc = _proc + proc.visible = True while True: