diff options
author | hjk <[email protected]> | 2020-08-11 10:09:54 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2020-08-12 07:25:28 +0000 |
commit | 27c3550d448d9134ad7b51c8be2d47a730ebdde6 (patch) | |
tree | fe7d2e17887fb05b698f03372b8fb82a8f3430fd /src/plugins/debugger/breakhandler.cpp | |
parent | 501e7c2fddec6b93e273dadcac389cd8c934cf00 (diff) |
Debugger: Fix crash when trying to remove all breakpoints of a file
Change-Id: Iea4478804be7b32a2da924e1163c5c4944c6e8a4
Fixes: QTCREATORBUG-24306
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/breakhandler.cpp')
-rw-r--r-- | src/plugins/debugger/breakhandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 13db44f7ca8..296866078b2 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -2629,15 +2629,16 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev) rowCount() > 0, &BreakpointManager::executeDeleteAllBreakpointsDialog); - // Delete by file: Find indices of breakpoints of the same file. + // Delete by file: Find breakpoints of the same file. GlobalBreakpoints breakpointsInFile; FilePath file; if (GlobalBreakpoint gbp = itemForIndexAtLevel<1>(ev.sourceModelIndex())) { file = gbp->markerFileName(); if (!file.isEmpty()) { - for (int i = 0; i != rowCount(); ++i) + forItemsAtLevel<1>([file, &breakpointsInFile](const GlobalBreakpoint &gbp) { if (gbp->markerFileName() == file) breakpointsInFile.append(gbp); + }); } } addAction(menu, tr("Delete Breakpoints of \"%1\"").arg(file.toUserOutput()), |