From 059b667af2ad311b41477b4f82e47ac562fed9dc Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Tue, 2 Jul 2024 13:19:45 +0100 Subject: [PATCH] ListenerList: Replace ListenerList with LightweightListenerList in select places --- modules/juce_audio_devices/native/juce_Midi_windows.cpp | 4 ++-- modules/juce_core/detail/juce_CallbackListenerList.h | 2 +- modules/juce_core/memory/juce_AllocationHooks.h | 2 +- modules/juce_osc/osc/juce_OSCReceiver.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/juce_audio_devices/native/juce_Midi_windows.cpp b/modules/juce_audio_devices/native/juce_Midi_windows.cpp index de7806c5fc..f5f2b46bcd 100644 --- a/modules/juce_audio_devices/native/juce_Midi_windows.cpp +++ b/modules/juce_audio_devices/native/juce_Midi_windows.cpp @@ -71,7 +71,7 @@ private: template auto createCheckedReference (Ptr* ptrIn) { - return std::shared_ptr> { new CheckedReference (ptrIn) }; + return std::make_shared> (ptrIn); } class MidiInput::Pimpl @@ -1251,7 +1251,7 @@ private: } //============================================================================== - ListenerList listeners; + ThreadSafeListenerList listeners; HashMap devices; CriticalSection deviceChanges; diff --git a/modules/juce_core/detail/juce_CallbackListenerList.h b/modules/juce_core/detail/juce_CallbackListenerList.h index a65398641e..0ee167f314 100644 --- a/modules/juce_core/detail/juce_CallbackListenerList.h +++ b/modules/juce_core/detail/juce_CallbackListenerList.h @@ -72,7 +72,7 @@ public: private: std::list callbacks; - ListenerList listeners; + LightweightListenerList listeners; }; } // namespace juce::detail diff --git a/modules/juce_core/memory/juce_AllocationHooks.h b/modules/juce_core/memory/juce_AllocationHooks.h index 6554ae3f9a..4a3ce11ea9 100644 --- a/modules/juce_core/memory/juce_AllocationHooks.h +++ b/modules/juce_core/memory/juce_AllocationHooks.h @@ -51,7 +51,7 @@ public: private: friend void notifyAllocationHooksForThread(); - ListenerList listenerList; + LightweightListenerList listenerList; }; //============================================================================== diff --git a/modules/juce_osc/osc/juce_OSCReceiver.cpp b/modules/juce_osc/osc/juce_OSCReceiver.cpp index 545a289299..0993ec7500 100644 --- a/modules/juce_osc/osc/juce_OSCReceiver.cpp +++ b/modules/juce_osc/osc/juce_OSCReceiver.cpp @@ -582,7 +582,7 @@ private: //============================================================================== ListenerList> listeners; - ListenerList> realtimeListeners; + LightweightListenerList> realtimeListeners; Array*>> listenersWithAddress; Array*>> realtimeListenersWithAddress;