Debugger: Fix potential crash

When triggering context menu on locals, receiving an update for
locals (e.g. still running fetch of locals finishes, expanding
children,..) and triggering an action referring to a former
now no more existing item.
Close the menu on updates to avoid this scenario.

Change-Id: I273bb85d497dfbaa257f267a866ea014a7e3b209
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2024-07-31 16:45:03 +02:00
parent 70c4d3f8c5
commit a8f74a011f

View File

@@ -1827,6 +1827,7 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
menu->addAction(s.settingsDialog.action());
// useDebuggingHelpers/useDynamicType have no auto-apply, but need to be persisted on triggered
connect(this, &WatchModel::dataChanged, menu, &QMenu::close);
connect(debugHelperAction, &QAction::triggered,
&s.useDebuggingHelpers, &BoolAspect::writeSettings, Qt::UniqueConnection);
connect(dynamicTypeAction, &QAction::triggered,