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

Added an assertion that will be triggered at the moment you attempt to delete a LookAndFeel object that's still in use somewhere

This commit is contained in:
jules 2017-10-19 11:58:50 +01:00
parent bf64d88de8
commit 6db06f7a9a
2 changed files with 16 additions and 0 deletions

View file

@ -50,6 +50,16 @@ LookAndFeel::LookAndFeel()
LookAndFeel::~LookAndFeel()
{
/* This assertion is triggered if you try to delete a LookAndFeel object while it's
- still being used as the default LookAndFeel; or
- is set as a Component's current lookandfeel; or
- pointed to by a WeakReference somewhere else in the code
Deleting a LookAndFeel is unlikely to cause a crash since most things will use a
safe WeakReference to it, but it could cause some unexpected graphical behaviour,
so it's advisable to clear up any references before destroying them!
*/
jassert (masterReference.getNumActiveWeakReferences() == 0);
}
//==============================================================================