There seems to be a bug in
ScopedPointer::operator= from an rvalue.
To reproduce the bug one can change the JUCE Demo’s AudioLatencyDemo for example:
AudioLatencyDemo::startTest(), remove the
if (latencyTester == nullptr)check. It’s ok to create a new
LatencyTestereach time it seems.
- Change the expression
new LatencyTester (resultsBox)to
ScopedPointer<LatencyTester> (new LatencyTester (resultsBox)).
- Run the JUCE demo (tested here on OS X 10.11.6 with Xcode 8.0 beta 4, on the current
developbranch - commit
70530a9) in debug.
- In the audio latency demo, run the latency more than once. Every time after the first leaks the previous tester object.
- Quit the JUCE demo. You should now get an assertion error for leaking
This seems to be the offending line: https://github.com/julianstorer/JUCE/commit/a92c7502b4e0246f8b28f214f8b2b52c73bf67c1#commitcomment-18830823