Memory leak when using mupdf-rs:
After completing the work of extracting the image from the document mupdf should free up used memory, but mupdf does not release the used memory, With each image extracted, memory consumption increases.
Here is a demo code to reproduce the problem: test_mupdf_memory_leak.rs.txt
I also noticed what I think is an instance of a memory leak in this library, specifically here in src/page.rs. It looks like the FFI layer transfers ownership of a slice to the rust layer, but the rust layer just reads it then copies it over elsewhere (thus leaving the slice leaked).
I think that #108 could help with this, and I'd be happy to help tackle these leaks once that is settled.
Pull requests are welcome!