Loading...
Searching...
No Matches
juce::MessageManager::LifetimeListener Struct Referenceabstract

Detailed Description

Receives callbacks when a MessageManager is starting or stopping.

Listeners are process-lifetime: they remain registered across MessageManager restart (for example a plugin reload). They are not unregistered automatically when the manager is deleted.

If you register after the current manager has already been created you will not receive messageManagerStarting() for that instance. Check getInstanceWithoutCreating() in your constructor if you need to catch up.

See also
addLifetimeListener, removeLifetimeListener

The documentation for this struct was generated from the following file:

Public Member Functions

 LifetimeListener ()
 Default constructor.
virtual ~LifetimeListener ()
 Destructor.
virtual void messageManagerStarting ()=0
 Called after a new MessageManager has been constructed and its platform message queue is ready, and before the dispatch loop is pumping.
virtual void messageManagerStopping ()=0
 Called after the manager has stopped accepting new messages, and before DeletedAtShutdown objects and the MessageManager itself are destroyed.

Constructors and Destructors

◆ LifetimeListener()

juce::MessageManager::LifetimeListener::LifetimeListener ( )

Default constructor.

Referenced by messageManagerStopping().

◆ ~LifetimeListener()

virtual juce::MessageManager::LifetimeListener::~LifetimeListener ( )
virtual

Destructor.

Member Functions

◆ messageManagerStarting()

virtual void juce::MessageManager::LifetimeListener::messageManagerStarting ( )
pure virtual

Called after a new MessageManager has been constructed and its platform message queue is ready, and before the dispatch loop is pumping.

This runs on the message thread. Posted callbacks will not run until the message loop starts (or the host pumps it). Do not wait for a posted message here; the loop is not pumping yet so that would deadlock.

◆ messageManagerStopping()

virtual void juce::MessageManager::LifetimeListener::messageManagerStopping ( )
pure virtual

Called after the manager has stopped accepting new messages, and before DeletedAtShutdown objects and the MessageManager itself are destroyed.

The MessageManager instance is still available. Do not post messages; they will be discarded.

References LifetimeListener().