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)
});
    connect(qApp, &QApplication::focusWindowChanged, [restore_action] (QWindow* window) {
        restore_action->setEnabled(window != nullptr);
    });
#endif
    if (walletFrame) {
        window_menu->addSeparator();
        QAction* main_window_action = window_menu->addAction(tr("Main Window"));
        connect(main_window_action, &QAction::triggered, [this] {
            GUIUtil::bringToFront(this);
        });
        window_menu->addSeparator();
        window_menu->addAction(usedSendingAddressesAction);
        window_menu->addAction(usedReceivingAddressesAction);
    }
    window_menu->addSeparator();
    for (RPCConsole::TabTypes tab_type : rpcConsole->tabs()) {
        QAction* tab_action = window_menu->addAction(rpcConsole->tabTitle(tab_type));
        connect(tab_action, &QAction::triggered, [this, tab_type] {
            rpcConsole->setTabFocus(tab_type);
            showDebugWindow();
        });
    }
    QMenu *help = appMenuBar->addMenu(tr("&Help"));
    help->addAction(showHelpMessageAction);
    help->addSeparator();
    help->addAction(aboutAction);
    help->addAction(aboutQtAction);
}
void BitcoinGUI::createToolBars()