mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Fix crash when opening theme editing window. (#2050)
This commit is contained in:
parent
37544b45d5
commit
5af4dce7f6
@ -156,8 +156,10 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent, MainWindow *main
|
||||
|
||||
addSeparator();
|
||||
|
||||
pluginMenu = mainWindow->getContextMenuExtensions(MainWindow::ContextMenuType::Disassembly);
|
||||
pluginActionMenuAction = addMenu(pluginMenu);
|
||||
if (mainWindow) {
|
||||
pluginMenu = mainWindow->getContextMenuExtensions(MainWindow::ContextMenuType::Disassembly);
|
||||
pluginActionMenuAction = addMenu(pluginMenu);
|
||||
}
|
||||
|
||||
addSeparator();
|
||||
|
||||
@ -529,9 +531,11 @@ void DisassemblyContextMenu::aboutToShowSlot()
|
||||
QString progCounterName = Core()->getRegisterName("PC").toUpper();
|
||||
actionSetPC.setText("Set " + progCounterName + " here");
|
||||
|
||||
pluginActionMenuAction->setVisible(!pluginMenu->isEmpty());
|
||||
for (QAction *pluginAction : pluginMenu->actions()) {
|
||||
pluginAction->setData(QVariant::fromValue(offset));
|
||||
if (pluginMenu) {
|
||||
pluginActionMenuAction->setVisible(!pluginMenu->isEmpty());
|
||||
for (QAction *pluginAction : pluginMenu->actions()) {
|
||||
pluginAction->setData(QVariant::fromValue(offset));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,8 +163,6 @@ private:
|
||||
QAction actionAddBreakpoint;
|
||||
QAction actionAdvancedBreakpoint;
|
||||
|
||||
QMenu *pluginMenu;
|
||||
|
||||
QAction actionSetToCode;
|
||||
|
||||
QAction actionSetAsStringAuto;
|
||||
@ -182,7 +180,8 @@ private:
|
||||
|
||||
QAction showInSubmenu;
|
||||
QList<QAction*> showTargetMenuActions;
|
||||
QAction *pluginActionMenuAction;
|
||||
QMenu *pluginMenu = nullptr;
|
||||
QAction *pluginActionMenuAction = nullptr;
|
||||
|
||||
// For creating anonymous entries (that are always visible)
|
||||
QAction *addAnonymousAction(QString name, const char *slot, QKeySequence shortcut);
|
||||
|
Loading…
Reference in New Issue
Block a user