diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index e4472309f2c..8a24e7e8269 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -120,10 +120,14 @@ public: void clicked() final { QTC_ASSERT(m_bp, return); - if (!m_bp->isEnabled()) - m_bp->setEnabled(true); - else + + if (m_bp->isEnabled()) { m_bp->deleteGlobalOrThisBreakpoint(); + return; + } + + if (const GlobalBreakpoint gbp = m_bp->globalBreakpoint()) + gbp->setEnabled(true); } public: