Browse Source

Made the PopupMenu keep a weak reference to its LookAndFeel, so that it'll avoid crashing in situations where the L+F is deleted while the menu is still on-screen.

tags/2021-05-28
jules 9 years ago
parent
commit
622add3dc9
2 changed files with 1 additions and 2 deletions
  1. +0
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp
  2. +1
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.h

+ 0
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -1234,7 +1234,6 @@ private:
//==============================================================================
PopupMenu::PopupMenu()
: lookAndFeel (nullptr)
{
}


+ 1
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.h View File

@@ -614,7 +614,7 @@ private:
friend class MenuBarComponent;
OwnedArray<Item> items;
LookAndFeel* lookAndFeel;
WeakReference<LookAndFeel> lookAndFeel;
Component* createWindow (const Options&, ApplicationCommandManager**) const;
int showWithOptionalCallback (const Options&, ModalComponentManager::Callback*, bool);


Loading…
Cancel
Save