I’m loading a file from a ZipFile which is stored in Binary Data.
I’m hitting the following assertion:
ZipFile::OpenStreamCounter::~OpenStreamCounter()
{
/* If you hit this assertion, it means you've created a stream to read one of the items in the
zipfile, but you've forgotten to delete that stream object before deleting the file..
Streams can't be kept open after the file is deleted because they need to share the input
stream that is managed by the ZipFile object.
*/
jassert (numOpenStreams == 0);
}
When the following block finishes:
{
// Load from binary data
MemoryBlock mb (BinaryData::freewordaudio_zip, BinaryData::freewordaudio_zipSize);
std::unique_ptr<MemoryInputStream> inputStream = std::make_unique<MemoryInputStream> (mb, false);
ZipFile audioZipFile (inputStream.release(), true);
// do stuff with the file data
} // <----- SIGILL (signal SIGILL: illegal instruction operand)
What I don’t get, is that I’m releasing the InputStream
pointer when passing it to the ZipFile
constructor, and also telling it to delete the InputStream
when it’s finished. So why is this assertion being hit?
I should also add that this is on Android, if it makes a difference…