scytheStudio / SCodes

This project is Qt & Qml wrapper for ZXing-C++ Library that is used for decoding 1D and 2D barcodes.
https://scythe-studio.com/
Apache License 2.0
107 stars 36 forks source link

Multi-Threading: Mistake causes freeze #38

Closed arBmind closed 7 months ago

arBmind commented 7 months ago

https://github.com/scytheStudio/SCodes/blob/3c9c37c8d55314a429cbb7d56f68834e1bb8cccf/src/SBarcodeScanner.cpp#L76-L86

Note that pauseProcessing() is called on the main thread while the Worker thread is processing an image and afterwards calls continueProcessing(). So I guess the library stops working because: continueProcessing() is called on Worker thread before the pauseProcessing() is called on main thread for the next camera frame.

Have fun 😥

radkoder commented 7 months ago

Thanks for noticing this issue. This code is long overdue for some simplification, you can expect this will be fixed soon. 🙂