mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 05:05:07 +00:00
LibLine: Restore previous state only if initialized
This makes the library safe to construct/destruct without actually using it.
This commit is contained in:
parent
cd1d369cdd
commit
8f08ec5038
1 changed files with 2 additions and 1 deletions
|
@ -44,6 +44,7 @@ Editor::Editor()
|
||||||
|
|
||||||
Editor::~Editor()
|
Editor::~Editor()
|
||||||
{
|
{
|
||||||
|
if (m_initialized)
|
||||||
tcsetattr(0, TCSANOW, &m_default_termios);
|
tcsetattr(0, TCSANOW, &m_default_termios);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue