Skip to content

Replace Breakpoint::setDeleted() with removeBreakpoint()

Jarmo Tiitto requested to merge jatothrim/kdevelop:work/breakpoint-remove into master

Freeing of the Breakpoint instances cannot happen before beginRemoveRows() nor breakpointAboutToBeDeleted(), so the duty of freeing must be contained in removeRows().

setDeleted() or delete breakpoint; can't work because of above.

  • Remove setDeleted() function.
  • Replace uses of setDeleted() with the removeBreakpoint().
  • Add comment to Breakpoint::deleted() that it should not be relied up on and it should go away.

The allowed ways to delete a Breakpoint is now any of:

  • BreakpointModel::removeBreakpoint(Breakpoint *breakpoint)
  • BreakpointModel::removeRow(...)
  • BreakpointModel::removeRows(...)

This brings things closer to removal of the dead list of breakpoints. The hack is still in place as I have not verified that all debugger plugins actually drop pointers to the removed breakpoints with breakpointAboutToBeDeleted().

The Breakpoint::deleted() is not yet factored out as some debugger plugins still depend on it:

  • kdev-python
  • kdev-xdebug

Note: The Breakpoint instances attached to the model with new Breakpoint(model,...) are owned by the BreakpointModel. Reviewing the code, this clearly has not always been the case, and the code has accumulated some rot since.

Merge request reports