I've been staring at this all afternoon trying to figure out why it's crashing. My juce version is from Git Dec 2, 2014. This is on Linux 32 bit.
My code looks like this:
File compFile(outputFilename); compFile.deleteFile(); // delete old one first FileOutputStream * streamOut = compFile.createOutputStream(); GZIPCompressorOutputStream *compOut = 0; Result status = streamOut->getStatus(); if (streamOut && status.wasOk()) compOut = new GZIPCompressorOutputStream(streamOut);
It crashes on the getResult() line. The code looks correct, and used to work until I upgraded my juce from a very old version. I was suspecting heap corruption from somewhere else, but it always crashes on this line of code. With heap corruption I'd expect it to crash somewhere else when I moved things around.
My call stack looks like this:
juce::Atomic<int>::operator++() at juce_Atomic.h:327 0x10c6f8 juce::StringHolder::retain() at 0x20dd28 juce::String::String() at juce_String.cpp:259 0x1bce1c juce::Result::Result() at juce_Result.cpp:37 0x1b4efc Compress() at Compress.cpp:155 0x12f5fc