Skip to content
  • Igor Kushnir's avatar
    Safely finalize and destroy DebugSession objects · 37ff587e
    Igor Kushnir authored
    DebugController is responsible for destroying debug sessions and it can
    not do so past its own destructor. Currently, depending on the relative
    timing of KDevelop exit and the 5 second interval of the singleshot
    timer in MIDebugSession::stopDebugger(), a DebugSession may be destroyed
    safely in time or not destroyed at all and possibly cause a crash by
    accessing the already destroyed DebugController or its children.
    
    Let us kill debugger processes and thus finalize the debug sessions'
    states in ~DebugController(). We delay the killing of debugger processes
    for as long as possible to give them a chance to exit on their own.
    
    Check ICore::documentController() for nullptr in
    BreakpointModel::updateMarks() and
    DebugController::clearExecutionPoint() to prevent crashes when these
    slots are invoked by DebugSession's state transition signals from
    inside ~DebugController(), which is called after ~DocumentController().
    
    BUG: 425991
    FIXED-IN: 5.6.1
    37ff587e