Python locks in memory a few global objects like lldb.debugger,lldb.target,... - as a consequence, ~Debugger isn't called upon shutdown.
Calling Debugger::Clear ensures that ScriptInterpreterPython::Clear is called to clean up Python global variables.
Details
Details
- Reviewers
clayborg
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I was debugging port forwarding with PlatformAndroid - in particular, whether forwarded ports are cleaned up with ~PlatformAndroidRemoteGDBServer. Turned out, that if there was at least one script command executed - platforms' destructors were never called.
source/Core/Debugger.cpp | ||
---|---|---|
426 | Wouldn't Clear() be considered a mutating function? So a const debugger ref seems like maybe it should be non-const? i.e. debugger->Clear(); } |
source/Core/Debugger.cpp | ||
---|---|---|
426 | Clear is mutable, but debugger has DebuggerSP type here - so, const is applicable only to shared_ptr, not to Debugger instance itself. |
source/Core/Debugger.cpp | ||
---|---|---|
426 | Ah gotcha. |
Wouldn't Clear() be considered a mutating function? So a const debugger ref seems like maybe it should be non-const?
i.e.
for (auto& debugger: debuggers) {
}