diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp index 144edd5997..9d2041d2b2 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp @@ -886,8 +886,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName) { const ScopedLock sl (audioCallbackLock); - oldCallbacks = callbacks; - callbacks.clear(); + oldCallbacks.swapWith (callbacks); } if (currentAudioDevice != nullptr) @@ -906,7 +905,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName) { const ScopedLock sl (audioCallbackLock); - callbacks = oldCallbacks; + oldCallbacks.swapWith (callbacks); } updateXml(); diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index 5903d9f024..280cc28f74 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -290,7 +290,11 @@ public: return *this; } - /** Scales this rectangle by the given amount, centred around the origin. */ + /** Returns a rectangle that has been scaled by the given amount, centred around the origin. + Note that if the rectangle has int coordinates and it's scaled by a + floating-point amount, then the result will be converted back to integer + coordinates using getSmallestIntegerContainer(). + */ template Rectangle operator* (FloatType scaleFactor) const noexcept { @@ -299,7 +303,11 @@ public: return r; } - /** Scales this rectangle by the given amount, centred around the origin. */ + /** Scales this rectangle by the given amount, centred around the origin. + Note that if the rectangle has int coordinates and it's scaled by a + floating-point amount, then the result will be converted back to integer + coordinates using getSmallestIntegerContainer(). + */ template Rectangle operator*= (FloatType scaleFactor) noexcept {