From cc1399a4b672aa4b9679b1febff3c8c762842612 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 17 Oct 2019 14:10:32 +0200 Subject: Debugger: Fix crash after breakpoint marker drag&drop The updateMarker function deletes the marker of the global breakpoint so don't call that function from the marker. Fixes: QTCREATORBUG-23107 Change-Id: I377608f1a08b61451be1fc0be5bc15252252a4a7 Reviewed-by: hjk --- src/plugins/debugger/breakhandler.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 8befb49f8e..4beee1d5a6 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -170,7 +170,6 @@ public: // the next line that generated code. m_gbp->m_params.lineNumber = lineNumber; - m_gbp->updateMarker(); m_gbp->update(); } @@ -186,14 +185,11 @@ public: void dragToLine(int line) final { + TextMark::move(line); QTC_ASSERT(m_gbp, return); QTC_ASSERT(BreakpointManager::globalBreakpoints().contains(m_gbp), return); - BreakpointParameters params = m_gbp->m_params; - params.lineNumber = line; - GlobalBreakpoint gbp = m_gbp; - m_gbp = GlobalBreakpoint(); - gbp->deleteBreakpoint(); - m_gbp = BreakpointManager::createBreakpoint(params); + m_gbp->m_params.lineNumber = line; + m_gbp->update(); } bool isClickable() const final { return true; } -- cgit v1.2.3