houqp / leptess

Productive and safe Rust binding for leptonica and tesseract
https://houqp.github.io/leptess/leptess/index.html
MIT License
258 stars 29 forks source link

Automatically drop Pix #2

Closed ccouzens closed 5 years ago

ccouzens commented 5 years ago

This is safe to do. Tesseract makes a copy of Pix. https://tesseract-ocr.github.io/4.0.0/a01625.html#ga0c4c7f05fd58b3665b123232a05545ad

We therefore do not need to worry about Pix being dropped before Tesseract.

houqp commented 5 years ago

Good catch! Looks like you accidentally included a bin file from vscode?

Since lifetime of api doesn't depend on pix anymore, it should be safe to automatically drop api as well right?

ccouzens commented 5 years ago

Looks like you accidentally included a bin file from vscode?

Oops. Thanks for spotting. I've rebased without that.

Since lifetime of api doesn't depend on pix anymore, it should be safe to automatically drop api as well right?

Maybe, I've not investigated that yet. I'll take a look tonight

houqp commented 5 years ago

Thanks for the rebase. I am fairly certain that it's safe to implement drop for api as well, but we can leave it to a different PR :)