Closed straussmaximilian closed 7 months ago
Don't call req.dealloc()
and handler.dealloc()
, those will clear the memory of these objects regardless of the number of references. Cocoa uses automatic memory management like Python and you don't have to manage memory manually.
The autorelease pool is useful because of the delayed reference count updates in Cocoa, this avoids using unnecessarily large amounts of memory when processing a lot of images.
Thanks for the quick reply. That fixed it! Thanks!!
Describe the bug Hi, Thank you for your fantastic library. I have used this and written a small wrapper around
VNRecognizeTextRequest
named ocrmac. I got a bug report that repeatedly calling this function causes a segmentation fault at random instances. I could reproduce it and created a minimal code example that reproduces this bug. Test files are here.Maybe I am doing something wrong when deallocating or this could be a bug? Any feedback is very much appreciated. Thank you!
Platform information
To Reproduce Download the test files and execute the code above: segmentation fault and random occurrences.
Expected behavior No segmentation fault.
Additional context Add any other context about the problem here.