From 0a8a9f60e1343d99d0d48e46e294c5bcd1bc300e Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 11 Apr 2019 09:35:22 +0200 Subject: [PATCH] Debugger: Coordinate breakpoint rampdown The update of the global came too early to properly check the condition whether it is still used. So fully remove usage first, then update, so the check operates on intended data. Fixes: QTCREATORBUG-22284 Change-Id: Iecdbdc371396132c88d0918f7cb253cf2627e0e3 Reviewed-by: Christian Stenger --- src/plugins/debugger/breakhandler.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 6e0ac9a7ff3..481c123046a 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -2031,14 +2031,18 @@ void BreakHandler::setWatchpointAtExpression(const QString &exp) void BreakHandler::releaseAllBreakpoints() { + GlobalBreakpoints gbps; for (Breakpoint bp : breakpoints()) { bp->removeChildren(); bp->destroyMarker(); - if (GlobalBreakpoint gbp = bp->globalBreakpoint()) - gbp->updateMarker(); + gbps.append(bp->globalBreakpoint()); } clear(); - // The now-unclaimed breakpoints are globally visible again. + // Make now-unclaimed breakpoints globally visible again. + for (GlobalBreakpoint gbp: qAsConst(gbps)) { + if (gbp) + gbp->updateMarker(); + } } QString BreakpointItem::msgWatchpointByExpressionTriggered(const QString &expr) const