Remove a special Windows-only call to WinPtyProcess.destroy idea/163.191
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 14 Jun 2016 20:00:54 +0000 (23:00 +0300)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 14 Jun 2016 20:00:54 +0000 (23:00 +0300)
commit8046616cc6688d5ef689a5b5cbaf769a4a2d8fad
tree32b27655c321a64b68e92f13393d75fe24b50ab8
parent69784f6d8e50cc6a8e1bb30d2dc9dc801c9e6c97
parentcc581fa2e7f0e265cb1fae86dda91541e8a4ed22
Remove a special Windows-only call to WinPtyProcess.destroy

This code isn't necessary anymore. The agent process automatically exits
once it flushes the last of the scraped CONOUT/CONERR into its output
pipes (WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN). We wouldn't want to kill
the agent before that point, because we'd generally lose data.

Even without WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN, it shouldn't be
necessary anymore to kill the agent. Once all (one or both) of the
WinPtyProcess's WinPTYInputStream instances have been closed, the WinPty
object is closed, which calls winpty_free, which kills the agent.

Analogously, with UnixPtyProcess, the pty master FDs are closed when the
input streams are closed.

In theory, I think this code could prematurely close the agent connection
while it still has data in its CONOUT/CONERR NamedPipe output queues. If
that happened, the data would be lost.