So this is a crash I’m seeing with my AAX build, but no other… and is new to AAX 2.x
If you create a new Introjucer AAX plugin and add a quick Slider class:
MyFader.h
#include "../JuceLibraryCode/JuceHeader.h"
#ifndef TestPI_MyFader_h
#define TestPI_MyFader_h
class CMyFader : public Slider
{
public:
CMyFader(const String& componentName);
~CMyFader();
private:
int iValue;
};
#endif
MyFader.cpp
#include "MyFader.h"
CMyFader::CMyFader(const String& componentName) : Slider(componentName)
{
setSize(50, 198);
setRange (0, 100, 1);
setTextBoxStyle (Slider::NoTextBox, false, 98, 12); // Assertion occurs here so lines below don't matter
setSliderSnapsToMousePosition(false);
setTopLeftPosition(12, 10);
}
CMyFader::~CMyFader()
{
}
In PluginProcessor.h add
private:
//==============================================================================
ScopedPointer<CMyFader> m_pFader;
In PluginProcessor.cpp add
void TestPiAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
// You should use this method to restore your parameters from this memory block,
// whose contents will have been created by the getStateInformation() call.
DBG("TestPiAudioProcessor::setStateInformation")
m_pFader = new CMyFader("test");
}
If you now save a session with the test plugin instantiated, then close and reopen the session you get an assertion:
JUCE Assertion failure in juce_AsyncUpdater.cpp:57
AsyncUpdater::~AsyncUpdater()
{
// You're deleting this object with a background thread while there's an update
// pending on the main event thread - that's pretty dodgy threading, as the callback could
// happen after this destructor has finished. You should either use a MessageManagerLock while
// deleting this object, or find some other way to avoid such a race condition.
jassert ((! isUpdatePending()) || MessageManager::getInstance()->currentThreadHasLockedMessageManager());
message->shouldDeliver.set (0);
}
I traced it to juce_Slider.cpp in lookAndFeelChanged() - line 586
valueBox = nullptr;
Anyone else see this or something similar?
Thanks,
Rail