twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
1.02k stars 293 forks source link

Strong reference cycle causing a memory leak #150

Open xmanu opened 3 weeks ago

xmanu commented 3 weeks ago

Recent versions of CodeScanner contain a strong reference cycle and therefore prevent the view from being correctly released. This was introduced somewhere after version 2.0.0.

This might also be the culprit for #121.

I have isolated the issue to the strong reference of [self] being captured while creating the handler. I will shortly create a PR to fix this issue.

xmanu commented 3 days ago

I'm sorry if this is bad etiquette or too pushy:

Is there any way this could be merged soonish? The change is really small and it would be nice if this could be released as a new version.

I don't know who to tag here, maybe @nathanfallet or @twostraws ?

Otherwise I have to link our project to my branch, which I would really like to prevent...