JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::Component::BailOutChecker Class Reference

A class to keep an eye on a component and check for it being deleted. More...

#include <juce_Component.h>

Collaboration diagram for juce::Component::BailOutChecker:

Public Member Functions

 BailOutChecker (Component *component)
 Creates a checker that watches one component. More...
 
bool shouldBailOut () const noexcept
 Returns true if either of the two components have been deleted since this object was created. More...
 

Private Attributes

const WeakReference< ComponentsafePointer
 

Detailed Description

A class to keep an eye on a component and check for it being deleted.

This is designed for use with the ListenerList::callChecked() methods, to allow the list iterator to stop cleanly if the component is deleted by a listener callback while the list is still being iterated.

Constructor & Destructor Documentation

◆ BailOutChecker()

juce::Component::BailOutChecker::BailOutChecker ( Component component)

Creates a checker that watches one component.

Member Function Documentation

◆ shouldBailOut()

bool juce::Component::BailOutChecker::shouldBailOut ( ) const
noexcept

Returns true if either of the two components have been deleted since this object was created.

Member Data Documentation

◆ safePointer

const WeakReference<Component> juce::Component::BailOutChecker::safePointer
private

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