dotnet / android-libzipsharp

A managed wrapper (and then some) around libzip (https://libzip.org/)
MIT License
30 stars 12 forks source link

Fixed a bug where the byte[] was being GC'd (or moved) before libzip could write it. #18

Closed dellis1972 closed 8 years ago

dellis1972 commented 8 years ago

some reason occasionally the byte[] was either being GC'd or moved before libzip could write the data to the file. As a result when libzip did try to write the data it gets an AccessViolation.

I tired Pinning the byte[] using a GCHandle but that did not seem to do the trick. So the fallback is to use a MemoryStream and go through the stream_callback system which we know works very well.

dellis1972 commented 8 years ago

Note this only happened on Windows when running under Visual Studio.