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 <hjk@qt.io>
This commit is contained in:
David Schulz
2019-10-17 14:10:32 +02:00
parent 418c7d108a
commit cc1399a4b6

View File

@@ -170,7 +170,6 @@ public:
// the next line that generated code. // the next line that generated code.
m_gbp->m_params.lineNumber = lineNumber; m_gbp->m_params.lineNumber = lineNumber;
m_gbp->updateMarker();
m_gbp->update(); m_gbp->update();
} }
@@ -186,14 +185,11 @@ public:
void dragToLine(int line) final void dragToLine(int line) final
{ {
TextMark::move(line);
QTC_ASSERT(m_gbp, return); QTC_ASSERT(m_gbp, return);
QTC_ASSERT(BreakpointManager::globalBreakpoints().contains(m_gbp), return); QTC_ASSERT(BreakpointManager::globalBreakpoints().contains(m_gbp), return);
BreakpointParameters params = m_gbp->m_params; m_gbp->m_params.lineNumber = line;
params.lineNumber = line; m_gbp->update();
GlobalBreakpoint gbp = m_gbp;
m_gbp = GlobalBreakpoint();
gbp->deleteBreakpoint();
m_gbp = BreakpointManager::createBreakpoint(params);
} }
bool isClickable() const final { return true; } bool isClickable() const final { return true; }