Fix ACP connection and thread leak (#35670)
When you switched away from an ACP thread, the `AcpThreadView` entity (and thus thread, and subprocess) was leaked. This happened because we were using `cx.processor` for the `list` state callback, which uses a strong reference. This PR changes the callback so that it holds a weak reference, and adds some tests and assertions at various levels to make sure we don't reintroduce the leak in the future. Release Notes: - N/A
This commit is contained in:
parent
f27dc7dec7
commit
b7469f5bc3
8 changed files with 73 additions and 27 deletions
|
@ -380,6 +380,7 @@ impl AcpConnection {
|
|||
|
||||
let stdin = child.stdin.take().unwrap();
|
||||
let stdout = child.stdout.take().unwrap();
|
||||
log::trace!("Spawned (pid: {})", child.id());
|
||||
|
||||
let foreground_executor = cx.foreground_executor().clone();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue