I use pre-allocated space, for backup-buffers in my audio-callback, and i create AudioSampleBuffers-Wrappers via setDataToReferTo, there is a call to allocatedData.free, i would be cool if you could add this check, to avoid a unnecessary call to std:free (It may sounds unimportant, but its a black-box, even when calling it with a nullptr, and i want to avoid any possible performance intrusion)
void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
const int newNumChannels,
const int newNumSamples) noexcept
{
jassert (dataToReferTo != nullptr);
jassert (newNumChannels >= 0 && newNumSamples >= 0);
if (allocatedBytes!=0) // <--
{
allocatedBytes = 0;
allocatedData.free();
};