mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-07 14:18:36 +02:00
Make sure to clean up ptm when detaching
Otherwise we hit an assert next time we attach
This commit is contained in:
parent
4631059c02
commit
9451b4d129
1 changed files with 10 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ struct _ply_terminal_session
|
|||
|
||||
uint32_t is_running : 1;
|
||||
uint32_t console_is_redirected : 1;
|
||||
uint32_t created_terminal_device : 1;
|
||||
};
|
||||
|
||||
static bool ply_terminal_session_open_console (ply_terminal_session_t *session);
|
||||
|
|
@ -325,6 +326,8 @@ ply_terminal_session_attach (ply_terminal_session_t *session,
|
|||
ply_trace ("could not create pseudo-terminal: %m");
|
||||
return false;
|
||||
}
|
||||
|
||||
session->created_terminal_device = true;
|
||||
}
|
||||
|
||||
if (should_redirect_console)
|
||||
|
|
@ -364,6 +367,13 @@ ply_terminal_session_detach (ply_terminal_session_t *session)
|
|||
ply_terminal_session_unredirect_console (session);
|
||||
}
|
||||
|
||||
if (session->created_terminal_device)
|
||||
{
|
||||
ply_trace ("ptmx wasn't originally passed in, destroying created one");
|
||||
ply_terminal_destroy_device (session->terminal);
|
||||
session->created_terminal_device = false;
|
||||
}
|
||||
|
||||
session->output_handler = NULL;
|
||||
session->done_handler = NULL;
|
||||
session->user_data = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue