ComboBox crash on click in ComponentPeer::getCurrentModfiersRealtime()

Hello Everyone, sorry in advance if this is a silly mistake because I’m pretty sure I must be doing something wrong but obviously after a couple of hours I can’t figure it out.

In my setup (OSX Mojave) I’m creating a simple plugin with nothing else but a ComboBox (The code is exactly what the GUI Creator in Projucer would create). But when I click on the ComboBox it opens and crashes immediately. I’m not even using a Listeners nor attachments, simply the ComboBox only as a GUI.

This is the code in the constructor of the PluginEditor

comboBox.reset (new ComboBox ("new combo box"));
addAndMakeVisible (comboBox.get());
comboBox->setEditableText (false);
comboBox->setJustificationType (Justification::centredLeft);
comboBox->setTextWhenNothingSelected (String());
comboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
comboBox->addItem (TRANS("Hola1"), 1);
comboBox->addItem (TRANS("Hola2"), 2);
comboBox->addItem (TRANS("Hola3"), 3);
comboBox->addListener (this);
comboBox->setBounds(144, 160, 150, 24);
setSize(600, 400); 

And of course the header file has

std::unique_ptr<ComboBox> comboBox;

The crash happens in the ComponentPeer class in juce_ComponentPeer.cpp in this section while opening with the AudioPluginHost

std::function<ModifierKeys()> ComponentPeer::getNativeRealtimeModifiers = nullptr;

ModifierKeys ComponentPeer::getCurrentModifiersRealtime() noexcept
{
    if (getNativeRealtimeModifiers != nullptr)
        return getNativeRealtimeModifiers(); //Crashes HERE!

    return ModifierKeys::currentModifiers;
}

with

JUCE Message Thread (1): EXC_BAD_ACCESS (code=1, address=0x20)

I’ve used ComboBoxes in the past so I don’t really understand what might be happening… maybe some OSX update broke something? My understanding is that the ComponentPeer class is to handle platform specific window handling, could this be the source of this problem?

Any help would be greatly appreciated :slight_smile:

Thanks

JuanS

I just started switching to 5.4 and now i’m also having this problem. I’m using the component as instructed so the problem seems to be internal.