I can reproduce an issue with master; v0.17.1rc1 works fine.

Steps to reproduce:
- `bitcoin-qt -regtest`
- open Console window
- repeat `generatetoaddress 1 AN_ADDRESS` some times until crash

Crash occurs both on wayland and x11.

[debug.log](https://github.com/bitcoin/bitcoin/files/2690776/debug.log)

[wallets.zip](https://github.com/bitcoin/bitcoin/files/2690781/wallets.zip)
{
    onDisplayUnitsClicked(event->pos());
}
void UnitDisplayStatusBarControl::createContextMenu()
{
    menu = new QMenu(this);
    for (const BitcoinUnits::Unit u : BitcoinUnits::availableUnits())
    {
        QAction *menuAction = new QAction(QString(BitcoinUnits::longName(u)), this);
        menuAction->setData(QVariant(u));
        menu->addAction(menuAction);
    }
    connect(menu, &QMenu::triggered, this, &UnitDisplayStatusBarControl::onMenuSelection);
}
void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *_optionsModel)