forked from PiekJ/SwiftOCR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify serial queue in init for multithreaded apps
Previously, the code would use .global(qos: .userInitiated) to specify which queue to use. This is a concurrent queue, so many quick calls to functions in SwiftOCR can result in EXC_BAD_ACCESS and other memory errors. This does not change the behavior of SwiftOCR for users who do not specifically opt into the fix by specifying a serial queue. Specify a serial queue like the following in your client code to opt in: let ocrQueue = DispatchQueue(label: "com.yourdomain.swiftocr") let ocr = SwiftOCR(dispatchQueue: ocrQueue)
- Loading branch information
Showing
1 changed file
with
31 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters