diff --git a/Libraries/LibDebug/DebugSession.cpp b/Libraries/LibDebug/DebugSession.cpp index 97d1d8d8f4a..c4dbc414d6b 100644 --- a/Libraries/LibDebug/DebugSession.cpp +++ b/Libraries/LibDebug/DebugSession.cpp @@ -38,6 +38,11 @@ DebugSession::DebugSession(int pid) DebugSession::~DebugSession() { + for (const auto& bp : m_breakpoints) { + disable_breakpoint(bp.key); + } + m_breakpoints.clear(); + if (!m_is_debugee_dead) { if (ptrace(PT_DETACH, m_debugee_pid, 0, 0) < 0) { perror("PT_DETACH");