Skip to content
Commit 2b68e11d authored by Igor Kushnir's avatar Igor Kushnir
Browse files

test_midbus: don't leak debug sessions

DebugController is responsible for destroying debug sessions in
KDevelop. Register test debug sessions with DebugController to properly
clean them up.

The following note is present in IDebugSession::breakpointController(),
IDebugSession::variableController() and IDebugSession::frameStackModel()
documentations:
  @note Implementations must ensure that a <(controller|model)> always
  exists (even if it is a dummy stub implementation that does nothing),
  and that it does not change during the lifetime of a session.
DebugController::addSession() asserts that these functions return
non-null pointers. Therefore TestDebugSession() creates these objects
now. Pure virtual MIDebugSession::breakpointController() overrides
IDebugSession::breakpointController() and returns
MIBreakpointController, which inherits IBreakpointController.
TestBreakpointController inherits IBreakpointController, not
MIBreakpointController. Thus TestDebugSession has to create non-dummy
MIBreakpointController rather than dummy TestBreakpointController.

This commit is a proper debug session leak fix that replaces recently
reverted fix in a wrong place 1256df11.
parent f051c8e3
Pipeline #311077 passed with stage
in 36 minutes and 13 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment