-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
I think you should use "ClosePseudoConsole" in "flutter_pty_win.c" , in function start_wait_exit_thread , here is the code:
static DWORD WINAPI wait_exit_thread(LPVOID arg)
{
WaitExitOptions *options = (WaitExitOptions *)arg;
DWORD exit_code = 0;
WaitForSingleObject(options->pid, INFINITE);
GetExitCodeProcess(options->pid, &exit_code);
CloseHandle(options->pid);
CloseHandle(options->hMutex);
ClosePseudoConsole(options->hpty); // To close the PseudoConsole
Dart_PostInteger_DL(options->port, exit_code);
return 0;
}
static void start_wait_exit_thread(HANDLE pid, Dart_Port port, HANDLE mutex, HPCON hpty)
{
WaitExitOptions *options = malloc(sizeof(WaitExitOptions));
options->pid = pid;
options->port = port;
options->hMutex = mutex;
options->hpty = hpty; // add htpy
DWORD thread_id;
HANDLE thread = CreateThread(NULL, 0, wait_exit_thread, options, 0, &thread_id);
if (thread == NULL)
{
free(options);
}
}
If not close the Pseudo , when close the port , there is a conhost process can not be kill.
Metadata
Metadata
Assignees
Labels
No labels