Browse Source

Added some extra clarification to a comment above the assertion in LookAndFeel's destructor

tags/2021-05-28
ed 7 years ago
parent
commit
f7741ee085
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp

+ 4
- 2
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp View File

@@ -60,8 +60,10 @@ LookAndFeel::~LookAndFeel()
Generally the fix for this will be to make sure you call
Component::setLookandFeel (nullptr) on any components that were still using
it before you delete it. Or call LookAndFeel::setDefaultLookAndFeel (nullptr)
if you had set it up to be the default one.
it before you delete it, or call LookAndFeel::setDefaultLookAndFeel (nullptr)
if you had set it up to be the default one. This assertion can also be avoided by
declaring your LookAndFeel object before any of the Components that use it as
the LookAndFeel will be destroyed before the Components.
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,


Loading…
Cancel
Save