1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added JUCE_DECLARE_WEAK_REFERENCEABLE macro to make it easier to creat weak-referenceable classes

This commit is contained in:
jules 2017-09-27 12:57:55 +01:00
parent b44cb8b710
commit 1aaa598a5f
13 changed files with 50 additions and 62 deletions

View file

@ -59,8 +59,6 @@ ActionBroadcaster::~ActionBroadcaster()
{
// all event-based objects must be deleted BEFORE juce is shut down!
jassert (MessageManager::getInstanceWithoutCreating() != nullptr);
masterReference.clear();
}
void ActionBroadcaster::addActionListener (ActionListener* const listener)

View file

@ -64,15 +64,13 @@ public:
private:
//==============================================================================
friend class WeakReference<ActionBroadcaster>;
WeakReference<ActionBroadcaster>::Master masterReference;
class ActionMessage;
friend class ActionMessage;
SortedSet<ActionListener*> actionListeners;
CriticalSection actionListenerLock;
JUCE_DECLARE_WEAK_REFERENCEABLE (ActionBroadcaster)
JUCE_DECLARE_NON_COPYABLE (ActionBroadcaster)
};