PluginListComponent::Scanner crashing

>    Plugin Host.exe!juce::Array<juce::String,juce::DummyCriticalSection,0>::Array<juce::String,juce::DummyCriticalSection,0>(const juce::Array<juce::String,juce::DummyCriticalSection,0> & other)  Line 78 + 0x6 bytes    C++
     Plugin Host.exe!juce::StringArray::StringArray(const juce::StringArray & other)  Line 35 + 0x18 bytes    C++
     Plugin Host.exe!juce::PluginListComponent::Scanner::finishedScan()  Line 477 + 0x2a bytes    C++
     Plugin Host.exe!juce::PluginListComponent::Scanner::timerCallback()  Line 493    C++
     Plugin Host.exe!juce::Timer::TimerThread::callTimers()  Line 130    C++
     Plugin Host.exe!juce::Timer::TimerThread::CallTimersMessage::messageCallback()  Line 199    C++
     Plugin Host.exe!juce::WindowsMessageHelpers::dispatchMessageFromLParam(long lParam)  Line 49    C++
     Plugin Host.exe!juce::MessageManager::dispatchNextMessageOnSystemQueue(const bool returnIfNoPendingMessages)  Line 110 + 0x9 bytes    C++
     Plugin Host.exe!juce::MessageManager::runDispatchLoopUntil(int millisecondsToRunFor)  Line 99 + 0x10 bytes    C++
     Plugin Host.exe!juce::MessageManager::runDispatchLoop()  Line 87    C++
     Plugin Host.exe!juce::JUCEApplicationBase::main()  Line 244    C++
     Plugin Host.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, HINSTANCE__ * __formal, HINSTANCE__ * __formal)  Line 102 + 0x18 bytes    C++
     Plugin Host.exe!__tmainCRTStartup()  Line 275 + 0x2c bytes    C
     Plugin Host.exe!WinMainCRTStartup()  Line 189    C
     [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]    

This is a stacktrace from a crash, there is a plugin (my plugin) in the scanned directory (only one directory on the list) and this is what happens. This does not look like my plugin is causing this, but there is something wrong with the Plugin Host itself. This is windows 7 x64 with VS2010 SP1.


Lots of people use the scanner, and I've not seen any bugs like that, I would certainly suspect that it's your plugin going wrong (probably a bug on shutdown) that's screwing up the stack and leading to problems after it has been unloaded.


It's weird since other hosts report no issues with it, so i the host became a suspect. I'll debug my plugin in the host and see if something goes wrong when unloading it.


You were correct it was my plugin trying to live for a moment longer to deliver any pending messages from the OS not to crash (the old OSX issue with plugins). I wonder if this is still an issue and if we still need a workaround for that ? Right now mine is to put something like that in the destructor of my AudioProcessor:

#ifdef JUCE_OSX