From a931b472d09f2b8bc5ca0952aeae503d3dee96f3 Mon Sep 17 00:00:00 2001 From: hogliux Date: Thu, 20 Oct 2016 15:45:30 +0100 Subject: [PATCH] Added a non-sense if statement to BufferingAudioSource to surpress an MSVC linker warning --- .../sources/juce_BufferingAudioSource.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp b/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp index e224c067df..3443e149de 100644 --- a/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp @@ -91,7 +91,12 @@ void BufferingAudioSource::releaseResources() backgroundThread.removeTimeSliceClient (this); buffer.setSize (numberOfChannels, 0); - source->releaseResources(); + + // MSVC2015 seems to need this if statement to not generate a warning during linking. + // As source is set in the constructor, there is no way that source could + // ever equal this, but it seems to make MSVC2015 happy. + if (source != this) + source->releaseResources(); } void BufferingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info)