Modal Windows in Wavelab - endless Loop


#1

Hi together,

Wavelab again… :frowning:

I opened a modal window from my plugin.
When i try too close wavelab while the modal window is open, the Wavelab GUI-Thread freezes.

Theres a infinity loop in Component::runModalLoop()

[code] while (flags.currentlyModalFlag && flags.visibleFlag)
{
if (! MessageManager::getInstance()->dispatchNextMessage())
break;

        // check whether this component was deleted during the last message
        if (! isValidMessageListener())
            break;
    }[/code]

Another thread from Wavelab (i think its the main-GUI Thread) tries to get the MessageManagerLock

> juce::CriticalSection::enter() Line 96 + 0xc bytes C++ juce::MessageManagerLock::MessageManagerLock() Line 345 C++ juce::Win32ComponentPeer::peerWindowProc(HWND__ * h=0x000b08c8, unsigned int message=49704, unsigned int wParam=0, long lParam=0) Line 1753 + 0x8 bytes C++ juce::Win32ComponentPeer::windowProc(HWND__ * h=0x000b08c8, unsigned int message=49704, unsigned int wParam=0, long lParam=0) Line 1744 + 0x18 bytes C++

Any help would be great!

regards
Christian


#2

Very nasty…

Isn’t the modal loop running on the main GUI thread, though? If not, then it probably should be…


#3

I think the problem is the wavelab uses more than one thread to handle GUI stuff.
The modal loop is started in the button-Listener of the Main-Plugin-GUI.

> juce::MessageManager::dispatchNextMessage(const bool returnImmediatelyIfNoMessages=false, bool * const wasAMessageDispa juce::Component::runModalLoop() Line 1448 + 0x10 bytes C++ juce::DialogWindow::showModalDialog(const juce::String & dialogTitle={...}, juce::Component * contentComponent=0x046420 my_test_plugin_editor_window::buttonClicked(juce::Button * buttonThatWasClicked=0x04009b78) Line 1293 + 0x61 bytes C++ juce::Button::sendClickMessage(const juce::ModifierKeys & modifiers={...}) Line 375 + 0x13 bytes C++ juce::Button::internalClickCallback(const juce::ModifierKeys & modifiers={...}) Line 307 C++ juce::Button::mouseUp(const juce::MouseEvent & e={...}) Line 450 + 0x19 bytes C++ juce::Component::internalMouseUp(const int oldModifiers=16, int x=49, int y=10, const __int64 time=1183042770828) Line juce::ComponentPeer::handleMouseUp(const int oldModifiers=16, int x=49, int y=10, const __int64 time=1183042770828) Li juce::Win32ComponentPeer::doMouseUp(const int x=403, const int y=18, const unsigned int wParam=0) Line 1458 C++ juce::Win32ComponentPeer::peerWindowProc(HWND__ * h=0x00150b44, unsigned int message=514, unsigned int wParam=0, long l juce::Win32ComponentPeer::windowProc(HWND__ * h=0x00150b44, unsigned int message=514, unsigned int wParam=0, long lPara


#4