# What's a recommended solution for Logic AU not dismissing an alertwindow, I tried this code already ..?

**URL:** <https://forum.juce.com/t/whats-a-recommended-solution-for-logic-au-not-dismissing-an-alertwindow-i-tried-this-code-already/60080>\
**Category:** General JUCE discussion\
**Created:** [February 20, 2024, 3:22pm UTC](https://forum.juce.com/t/whats-a-recommended-solution-for-logic-au-not-dismissing-an-alertwindow-i-tried-this-code-already/60080 "2024-02-20T15:22:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian-SAfc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ian-safc/32/17877_2.png) [@Ian-SAfc](https://forum.juce.com/u/Ian-SAfc)\
**Post date:** [February 20, 2024, 3:22pm UTC](https://forum.juce.com/t/whats-a-recommended-solution-for-logic-au-not-dismissing-an-alertwindow-i-tried-this-code-already/60080/1 "2024-02-20T15:22:00Z")

</div>

I have a bug unique to Logic, AU component build.  
I did see one or two others on the forum having a similar issue, e.g. [here](https://forum.juce.com/t/combobox-popupmenu-doesnt-disappear-and-is-always-on-top/35841/3)., @lalala

I did try this code, but it didn’t work. When I **close**  **the whole plugin window** in Logic, my popup alertwindow which I invoked still stays visible, and if I click an option on that menu, Logic crashes.  
Has there been an evolution in the JUCE framework to handle this, or some better way to deal with the issue?

```auto
Component* getParentComponentForMenuOptions (const PopupMenu::Options& options) override
{
    if (auto* comp = options.getParentComponent())
        return comp;

    if (auto* targetComp = options.getTargetComponent())
    {
        if (auto* editor = targetComp->findParentComponentOfClass<AudioProcessorEditor>())
            return editor;
    }

    return LookAndFeel_V4::getParentComponentForMenuOptions (options);
}

```

Anyone get anywhere with `dismissAllActiveMenus()`?

---

<div class="post-metadata">

**Author:** ![Ian-SAfc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ian-safc/32/17877_2.png) [@Ian-SAfc](https://forum.juce.com/u/Ian-SAfc)\
**Post date:** [February 20, 2024, 8:44pm UTC](https://forum.juce.com/t/whats-a-recommended-solution-for-logic-au-not-dismissing-an-alertwindow-i-tried-this-code-already/60080/2 "2024-02-20T20:44:42Z")

</div>

I did make a little progress with the popup menus.  
Putting this in the Editor destructor dismissed my menu:  
` juce::PopupMenu::dismissAllActiveMenus();`

I was hoping this would dismiss my dialog box alertwindow but it crashed Logic:  
` juce::ModalComponentManager::getInstance()->cancelAllModalComponents();`
