lalala
July 31, 2018, 8:01am
1
if a slider is destructed while its PopupDisplayComponent
exists then we get a EXC_BAD_ACCESS
in the PopupDisplayComponent
destructor.
to reproduce :
open the demo runner -> widgetdemo -> sliders tab
hover the slider that is at the extreme right to see its PopupDisplayComponent
quit (cmd+q
) the app while the PopupDisplayComponent
is shown
ed95
July 31, 2018, 8:21am
2
Thanks, I’ll sort this out.
1 Like
I have a derived Slider class with a L&F… and even though the LookAndFeel is declared as the first variable in the class and I have:
setLookAndFeel (nullptr);
in the destructor… if I quit while the pimpl->popupDisplay is visible then I hit the ~LookAndFeel()
assertion.
Rail
ed95
January 21, 2019, 11:28am
4
Adding the following lines to the destructor of your derived Slider
should fix the issue:
if (auto* popup = getCurrentPopupDisplay())
popup->setLookAndFeel (nullptr);
1 Like
Thanks! Oddly enough it needs both…
MixerFader::~MixerFader()
{
if (auto* popup = getCurrentPopupDisplay())
popup->setLookAndFeel (nullptr);
setLookAndFeel (nullptr);
}
Even though the L&F is the first class variable defined.
Cheers,
Rail
ed95
January 22, 2019, 9:31am
6
Yeah, it’s because the Slider
and its PopupDisplayComponent
hold a reference to the L&F and they are destroyed after your derived class which contains the L&F object.
That explains the refCount value of 2 I was seeing.
Thanks!
Rail