https://bugs.kde.org/show_bug.cgi?id=394104
Igor Kushnir <igor...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version Fixed In| |5.11.230400 Latest Commit| |https://invent.kde.org/kdev | |elop/kdevelop/commit/f051c8 | |e3df8bf5ca9e8f8572d324900db | |316001e Resolution|--- |FIXED Status|CONFIRMED |RESOLVED --- Comment #3 from Igor Kushnir <igor...@gmail.com> --- Git commit f051c8e3df8bf5ca9e8f8572d324900db316001e by Igor Kushnir. Committed on 20/01/2023 at 09:55. Pushed by igorkushnir into branch 'master'. Don't leak the debug session if a debug job finishes in destructor The constructor of a MI debug job creates a debug session. A debug session emits finished() and is destroyed when it finishes. A MI debug job finishes normally when its debug session emits finished(). When a MI debug job is killed, it calls MIDebugSession::stopDebugger(), which finishes the debug session. However, when a MI debug job is destroyed before it starts running, the debug session is leaked. A job should never leak resources, no matter when or how it is destroyed. If a MIDebugJob has a dependency, GdbLauncher::start() adds the MIDebugJob as the second subjob of an ExecuteCompositeJob. If an ExecuteCompositeJob is configured to abort on error (which is the default and almost always the case), when a subjob finishes with an error, the remaining subjobs are never started, the composite job finishes and is soon destroyed. The remaining subjobs are owned by the composite job and are destroyed along with it. This scenario happens when a MIDebugJob job depends on a build job, and the build job fails, e.g. because of a syntax error in the program. Without this commit, the job's debug session is not destroyed and the Debug area remains active in KDevelop then. ExecuteCompositeJob::doKill() does not kill the remaining subjobs if killing a subjob fails. Since ExecuteCompositeJob is a parent of its subjobs, the not-killed subjobs are eventually destroyed along with it. Furthermore, I believe that not-started subjobs should always be simply destroyed rather than killed, and plan to implement this change soon. FIXED-IN: 5.11.230400 M +11 -0 plugins/debuggercommon/midebugjobs.cpp M +1 -0 plugins/debuggercommon/midebugjobs.h https://invent.kde.org/kdevelop/kdevelop/commit/f051c8e3df8bf5ca9e8f8572d324900db316001e -- You are receiving this mail because: You are watching all bug changes.